summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2b6eef9)
raw | patch | inline | side by side (parent: 2b6eef9)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 7 Sep 2006 07:54:22 +0000 (00:54 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 7 Sep 2006 09:44:41 +0000 (02:44 -0700) |
... without --full-index.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history |
index 9dcbda3117a5b225aa5ee0f077b03cf8e859228b..6638865709888cc0ad2860ca1389a098b6f402f1 100644 (file)
--- a/diff.c
+++ b/diff.c
if (hashcmp(one->sha1, two->sha1)) {
int abbrev = o->full_index ? 40 : DEFAULT_ABBREV;
+ if (o->binary) {
+ mmfile_t mf;
+ if ((!fill_mmfile(&mf, one) && mmfile_is_binary(&mf)) ||
+ (!fill_mmfile(&mf, two) && mmfile_is_binary(&mf)))
+ abbrev = 40;
+ }
len += snprintf(msg + len, sizeof(msg) - len,
"index %.*s..%.*s",
abbrev, sha1_to_hex(one->sha1),
options->full_index = 1;
else if (!strcmp(arg, "--binary")) {
options->output_format |= DIFF_FORMAT_PATCH;
- options->full_index = options->binary = 1;
+ options->binary = 1;
}
else if (!strcmp(arg, "-a") || !strcmp(arg, "--text")) {
options->text = 1;