Merge branch 'ew/empty-merge-with-dirty-index-maint' into ew/empty-merge-with-dirty-index
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 516f68dbb42298d1c8bb509397f6c2eb6dfc93cb..3fb445a54d94f5f48aabed0fcfd06c378bee6719 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -4920,14 +4920,20 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)
        int abblen;
        const char *abbrev;
 
+       /* Do we want all 40 hex characters? */
        if (len == GIT_SHA1_HEXSZ)
                return oid_to_hex(oid);
 
+       /* An abbreviated value is fine, possibly followed by an ellipsis. */
        abbrev = diff_abbrev_oid(oid, len);
+
+       if (!print_sha1_ellipsis())
+               return abbrev;
+
        abblen = strlen(abbrev);
 
        /*
-        * In well-behaved cases, where the abbbreviated result is the
+        * In well-behaved cases, where the abbreviated result is the
         * same as the requested length, append three dots after the
         * abbreviation (hence the whole logic is limited to the case
         * where abblen < 37); when the actual abbreviated result is a