Merge branch 'jk/ident-loosen-getpwuid' into maint
[gitweb.git] / builtin / merge-file.c
index ea8093f6769e278c4f7871faf405fe1e3f0a7544..55447053f2dde004ceffff9967b015b4a01c35d1 100644 (file)
@@ -75,7 +75,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
                        names[i] = argv[i];
                if (read_mmfile(mmfs + i, fname))
                        return -1;
-               if (buffer_is_binary(mmfs[i].ptr, mmfs[i].size))
+               if (mmfs[i].size > MAX_XDIFF_SIZE ||
+                   buffer_is_binary(mmfs[i].ptr, mmfs[i].size))
                        return error("Cannot merge binary files: %s",
                                        argv[i]);
        }
@@ -103,5 +104,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
                free(result.ptr);
        }
 
+       if (ret > 127)
+               ret = 127;
+
        return ret;
 }