summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-31 22:49:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-31 22:49:46 (GMT)
commit096c948dabc7d13a6cc81a8ad803fd96fc1c5d15 (patch)
tree485338e755482416f20097587126fcaf795ec170 /diff.c
parent1a753720c3c416ed53e985ace9f8f1232118c516 (diff)
parent3046c7f69a6337a971b219d047b8110e3f9ea971 (diff)
downloadgit-096c948dabc7d13a6cc81a8ad803fd96fc1c5d15.zip
git-096c948dabc7d13a6cc81a8ad803fd96fc1c5d15.tar.gz
git-096c948dabc7d13a6cc81a8ad803fd96fc1c5d15.tar.bz2
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index f175019..e3a5ee3 100644
--- a/diff.c
+++ b/diff.c
@@ -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;