summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-04-26 10:35:33 -0700
committerJunio C Hamano <gitster@pobox.com>2012-04-26 10:35:33 -0700
commit3f231e235fb4b9c4d937a50fa4fbf35f9ed10387 (patch)
tree6f064ed970aa6363222824e2899681c383544c2d /t
parent10a20b43c3d03ea1fab9095f96eda66086d3dcd2 (diff)
parent4f7cb99ada26be5d86402a6e060f3ee16a672f16 (diff)
downloadgit-3f231e235fb4b9c4d937a50fa4fbf35f9ed10387.tar.gz
Merge branch 'jk/diff-no-rename-empty' into maint
Rename detection logic used to match two empty files as renames during merge-recursive, leading unnatural mismerges. By Jeff King * jk/diff-no-rename-empty: merge-recursive: don't detect renames of empty files teach diffcore-rename to optionally ignore empty content make is_empty_blob_sha1 available everywhere drop casts from users EMPTY_TREE_SHA1_BIN
Diffstat (limited to 't')
-rwxr-xr-xt/t6022-merge-rename.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh
index 9d8584e957..1104249182 100755
--- a/t/t6022-merge-rename.sh
+++ b/t/t6022-merge-rename.sh
@@ -884,4 +884,20 @@ test_expect_success 'no spurious "refusing to lose untracked" message' '
! grep "refusing to lose untracked file" errors.txt
'
+test_expect_success 'do not follow renames for empty files' '
+ git checkout -f -b empty-base &&
+ >empty1 &&
+ git add empty1 &&
+ git commit -m base &&
+ echo content >empty1 &&
+ git add empty1 &&
+ git commit -m fill &&
+ git checkout -b empty-topic HEAD^ &&
+ git mv empty1 empty2 &&
+ git commit -m rename &&
+ test_must_fail git merge empty-base &&
+ >expect &&
+ test_cmp expect empty2
+'
+
test_done