diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-15 15:08:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-15 15:08:26 -0700 |
commit | e4095da40eef81f853bbeedf44d7f344bf682232 (patch) | |
tree | 456ce3ad1c5bc26992b02536fbe294f619b12cec /t | |
parent | Merge branch 'jt/tag-following-with-proto-v2-fix' (diff) | |
parent | merge-recursive: preserve skip_worktree bit when necessary (diff) | |
download | tgif-e4095da40eef81f853bbeedf44d7f344bf682232.tar.xz |
Merge branch 'en/merge-recursive-skip-fix'
When the sparse checkout feature is in use, "git cherry-pick" and
other mergy operations lost the skip_worktree bit when a path that
is excluded from checkout requires content level merge, which is
resolved as the same as the HEAD version, without materializing the
merge result in the working tree, which made the path appear as
deleted. This has been corrected by preserving the skip_worktree
bit (and not materializing the file in the working tree).
* en/merge-recursive-skip-fix:
merge-recursive: preserve skip_worktree bit when necessary
t3507: add a testcase showing failure with sparse checkout
Diffstat (limited to 't')
-rwxr-xr-x | t/t3507-cherry-pick-conflict.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh index 7c5ad08626..0db166152a 100755 --- a/t/t3507-cherry-pick-conflict.sh +++ b/t/t3507-cherry-pick-conflict.sh @@ -392,4 +392,17 @@ test_expect_success 'commit --amend -s places the sign-off at the right place' ' test_cmp expect actual ' +test_expect_success 'cherry-pick preserves sparse-checkout' ' + pristine_detach initial && + test_config core.sparseCheckout true && + test_when_finished " + echo \"/*\" >.git/info/sparse-checkout + git read-tree --reset -u HEAD + rm .git/info/sparse-checkout" && + echo /unrelated >.git/info/sparse-checkout && + git read-tree --reset -u HEAD && + test_must_fail git cherry-pick -Xours picked>actual && + test_i18ngrep ! "Changes not staged for commit:" actual +' + test_done |