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
This commit is contained in:
Junio C Hamano
2020-08-31 15:49:46 -07:00
6 changed files with 138 additions and 26 deletions

5
diff.c
View File

@ -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;