summaryrefslogtreecommitdiff
path: root/builtin-merge-file.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-06-05 02:37:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-05 06:10:29 (GMT)
commit5771907a5745799c559ff21ccfcabfd21cc23b36 (patch)
tree47427699ad65ca3a9bd1b5192e53490fc5166623 /builtin-merge-file.c
parent9f30855d0ff5206e85e45f0307be9d18ffda41d3 (diff)
downloadgit-5771907a5745799c559ff21ccfcabfd21cc23b36.zip
git-5771907a5745799c559ff21ccfcabfd21cc23b36.tar.gz
git-5771907a5745799c559ff21ccfcabfd21cc23b36.tar.bz2
git-merge-file: refuse to merge binary files
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-merge-file.c')
-rw-r--r--builtin-merge-file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index 9135773..10ec63b 100644
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
@@ -36,9 +36,13 @@ int cmd_merge_file(int argc, char **argv, char **envp)
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);