Skip to content

Fix sparse checkout file list for rebase onto remote branch

Ingo van Lil requested to merge inguin/gitaly:rebase-sparse-filelist into master

The rebase operation uses sparse checkouts for performance reasons: It checks out only those files that have been changed between the branch to be rebased and its parent.

In case the destination branch is in a remote repository that sparse checkout file list is incorrectly generated by using the local head of the destination branch, not the remote one. This can cause performance problems (if the list is too long) or operation failures (if it is too short).

The correct order of operations is to fetch the remote branch first, then compare the local branch to the fetched head.

Closes #2759 (closed)

Merge request reports