summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 634cd48)
raw | patch | inline | side by side (parent: 634cd48)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 5 Jun 2007 02:36:49 +0000 (03:36 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 16 Jun 2007 06:28:10 +0000 (23:28 -0700) |
[jc: cherry-picked 9f30855 from 'master']
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c | patch | blob | history | |
t/t6024-recursive-merge.sh | patch | blob | history |
diff --git a/merge-recursive.c b/merge-recursive.c
index 8f72b2c079a68ac5cb9d1c90bb7b72fa779efb5f..4a82b741ae020376ac67b34d5fce86e8a87a3b5d 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
{
xpparam_t xpp;
+ if (buffer_is_binary(orig->ptr, orig->size) ||
+ buffer_is_binary(src1->ptr, src1->size) ||
+ buffer_is_binary(src2->ptr, src2->size))
+ return error("Cannot merge binary files: %s vs. %s\n",
+ name1, name2);
+
memset(&xpp, 0, sizeof(xpp));
return xdl_merge(orig,
src1, name1,
index a398556137205d9fb561746335a13330a5aeda54..058db9cc52521a9ba9e408c9455645d8adc4ba79 100755 (executable)
test_expect_success "virtual trees were processed" "git diff expect out"
+git reset --hard
+test_expect_success 'refuse to merge binary files' '
+ printf "\0" > binary-file &&
+ git add binary-file &&
+ git commit -m binary &&
+ git checkout G &&
+ printf "\0\0" > binary-file &&
+ git add binary-file &&
+ git commit -m binary2 &&
+ ! git merge F > merge.out 2> merge.err &&
+ grep "Cannot merge binary files: HEAD:binary-file vs. F:binary-file" \
+ merge.err
+'
+
test_done