Skip to content

Commit 30fd3a5

Browse files
Clemens Buchachergitster
authored andcommitted
merge overwrites unstaged changes in renamed file
Signed-off-by: Clemens Buchacher <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 36e6c80 commit 30fd3a5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

t/t7607-merge-overwrite.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ test_expect_success 'will not overwrite removed file with staged changes' '
9292
test_cmp important c1.c
9393
'
9494

95+
test_expect_failure 'will not overwrite unstaged changes in renamed file' '
96+
git reset --hard c1 &&
97+
git mv c1.c other.c &&
98+
git commit -m rename &&
99+
cp important other.c &&
100+
git merge c1a &&
101+
test_cmp important other.c
102+
'
103+
95104
test_expect_success 'will not overwrite untracked subtree' '
96105
git reset --hard c0 &&
97106
rm -rf sub &&

0 commit comments

Comments
 (0)