diff options
| author | Junio C Hamano <junkio@cox.net> | 2006-09-13 12:39:02 -0700 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2006-09-13 12:39:02 -0700 |
| commit | ae44b235d49db30324819f4775897d9a74ee1aad (patch) | |
| tree | 8e425da11b0f6e5e47837ae1906327558d1e93fe /diff.c | |
| parent | f6e8dd3b438992d22a6a2173f8980eae9dabaf37 (diff) | |
| parent | 82793c55e45ea1c7306ff396d8ce316241e584da (diff) | |
| download | git-ae44b235d49db30324819f4775897d9a74ee1aad.tar.gz | |
Merge branch 'jc/binary'
* jc/binary:
diff --binary generates full index on binary files.
Make apply --binary a no-op.
Diffstat (limited to 'diff.c')
| -rw-r--r-- | diff.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1588,6 +1588,12 @@ static void run_diff(struct diff_filepair *p, struct diff_options *o) 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), @@ -1818,7 +1824,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) 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; |
