diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-08-31 15:49:46 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-31 15:49:46 -0700 |
commit | 096c948dabc7d13a6cc81a8ad803fd96fc1c5d15 (patch) | |
tree | 485338e755482416f20097587126fcaf795ec170 /diff.c | |
parent | Merge branch 'am/ci-wsfix' (diff) | |
parent | diff: index-line: respect --abbrev in object's name (diff) | |
download | tgif-096c948dabc7d13a6cc81a8ad803fd96fc1c5d15.tar.xz |
Merge branch 'dd/diff-customize-index-line-abbrev'
The output from the "diff" family of the commands had abbreviated
object names of blobs involved in the patch, but its length was not
affected by the --abbrev option. Now it is.
* dd/diff-customize-index-line-abbrev:
diff: index-line: respect --abbrev in object's name
t4013: improve diff-post-processor logic
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -4319,7 +4319,10 @@ static void fill_metainfo(struct strbuf *msg, } if (one && two && !oideq(&one->oid, &two->oid)) { const unsigned hexsz = the_hash_algo->hexsz; - int abbrev = o->flags.full_index ? hexsz : DEFAULT_ABBREV; + int abbrev = o->abbrev ? o->abbrev : DEFAULT_ABBREV; + + if (o->flags.full_index) + abbrev = hexsz; if (o->flags.binary) { mmfile_t mf; |