aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-06-21 12:52:11 +0100
committerJunio C Hamano <gitster@pobox.com>2007-06-22 22:43:51 -0700
commit0ce396431ee710aa406f7e41ad9578dcac54085f (patch)
tree76cf6597b637e6ea2afc0e923719cfc3d2de8d32 /t
parent37cd4f7e820da82e5731c06b7ebf83963d796e5e (diff)
downloadgit-0ce396431ee710aa406f7e41ad9578dcac54085f.tar.gz
git-0ce396431ee710aa406f7e41ad9578dcac54085f.tar.xz
diffcore-rename: favour identical basenames
When there are several candidates for a rename source, and one of them has an identical basename to the rename target, take that one. Noticed by Govind Salinas, posted by Shawn O. Pearce, partial patch by Linus Torvalds. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4001-diff-rename.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
index 2e3c20d6b..90c085f82 100755
--- a/t/t4001-diff-rename.sh
+++ b/t/t4001-diff-rename.sh
@@ -64,4 +64,17 @@ test_expect_success \
'validate the output.' \
'compare_diff_patch current expected'
+test_expect_success 'favour same basenames over different ones' '
+ cp path1 another-path &&
+ git add another-path &&
+ git commit -m 1 &&
+ git rm path1 &&
+ mkdir subdir &&
+ git mv another-path subdir/path1 &&
+ git runstatus | grep "renamed: .*path1 -> subdir/path1"'
+
+test_expect_success 'favour same basenames even with minor differences' '
+ git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
+ git runstatus | grep "renamed: .*path1 -> subdir/path1"'
+
test_done