summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f30855)
raw | patch | inline | side by side (parent: 9f30855)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 5 Jun 2007 02:37:13 +0000 (03:37 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 5 Jun 2007 06:10:29 +0000 (23:10 -0700) |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-merge-file.c | patch | blob | history | |
t/t6023-merge-file.sh | patch | blob | history |
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index 913577390862a847857a650516740059072b60ad..10ec63b17e6b16382f2b39e5c01cc6cf1dce448e 100644 (file)
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
for (; i < 3; i++)
names[i] = argv[i + 1];
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 3; i++) {
if (read_mmfile(mmfs + i, argv[i + 1]))
return -1;
+ if (buffer_is_binary(mmfs[i].ptr, mmfs[i].size))
+ return error("Cannot merge binary files: %s\n",
+ argv[i + 1]);
+ }
ret = xdl_merge(mmfs + 1, mmfs + 0, names[0], mmfs + 2, names[2],
&xpp, XDL_MERGE_ZEALOUS, &result);
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index c76fccfb5a0811aca3bb5af67f8558745935148f..1decbfba63298e01a757851f9954fac6c54ba494 100755 (executable)
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
test_expect_success "expected conflict markers" "git diff expect out"
+test_expect_success 'binary files cannot be merged' '
+ ! git merge-file -p orig.txt ../test4012.png new1.txt 2> merge.err &&
+ grep "Cannot merge binary files" merge.err
+'
+
test_done