Code

merge overwrites unstaged changes in renamed file
authorClemens Buchacher <drizzd@aon.at>
Sat, 14 Apr 2012 23:15:17 +0000 (01:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Apr 2012 05:44:39 +0000 (22:44 -0700)
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7607-merge-overwrite.sh

index aa74184c31cd6b2bd2e0e566e6805e60eed7aff8..6547eb8f5459d4d95113469d338e1879f86b79ea 100755 (executable)
@@ -92,6 +92,15 @@ test_expect_success 'will not overwrite removed file with staged changes' '
        test_cmp important c1.c
 '
 
+test_expect_failure 'will not overwrite unstaged changes in renamed file' '
+       git reset --hard c1 &&
+       git mv c1.c other.c &&
+       git commit -m rename &&
+       cp important other.c &&
+       git merge c1a &&
+       test_cmp important other.c
+'
+
 test_expect_success 'will not overwrite untracked subtree' '
        git reset --hard c0 &&
        rm -rf sub &&