read-tree -m -u: do not overwrite or remove untracked working tree files.
When a merge results in a creation of a path that did not exist in HEAD, and if you already have that path on the working tree, because the index has not been told about the working tree file, read-tree happily removes it. The issue was brought up by Santi Béjar on the list. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
@ -191,7 +191,7 @@ test_expect_success \
|
||||
'rm -fr Z [A-Z][A-Z] &&
|
||||
git-read-tree $tree_A &&
|
||||
git-checkout-index -f -a &&
|
||||
git-read-tree -m $tree_O || return 1
|
||||
git-read-tree --reset $tree_O || return 1
|
||||
git-update-index --refresh >/dev/null ;# this can exit non-zero
|
||||
git-diff-files >.test-a &&
|
||||
cmp_diff_files_output .test-a .test-recursive-OA'
|
||||
@ -201,7 +201,7 @@ test_expect_success \
|
||||
'rm -fr Z [A-Z][A-Z] &&
|
||||
git-read-tree $tree_B &&
|
||||
git-checkout-index -f -a &&
|
||||
git-read-tree -m $tree_O || return 1
|
||||
git-read-tree --reset $tree_O || return 1
|
||||
git-update-index --refresh >/dev/null ;# this can exit non-zero
|
||||
git-diff-files >.test-a &&
|
||||
cmp_diff_files_output .test-a .test-recursive-OB'
|
||||
@ -211,7 +211,7 @@ test_expect_success \
|
||||
'rm -fr Z [A-Z][A-Z] &&
|
||||
git-read-tree $tree_B &&
|
||||
git-checkout-index -f -a &&
|
||||
git-read-tree -m $tree_A || return 1
|
||||
git-read-tree --reset $tree_A || return 1
|
||||
git-update-index --refresh >/dev/null ;# this can exit non-zero
|
||||
git-diff-files >.test-a &&
|
||||
cmp_diff_files_output .test-a .test-recursive-AB'
|
||||
|
||||
Reference in New Issue
Block a user