diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value
Neither Git nor the user are in need of this (visual) aid anymore, but we must offer a transition period. A follow-up patch (series) will rectify the situation by covering the new output format as well as the backward compatible one. Also, fix a typo: "abbbreviated" ---> "abbreviated". Signed-off-by: Ann T Ropea <bedhanger@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ann T Ropea committed
Dec 3, 2017 at 22:27 UTC
7cb6ac1e4b5c58b515ca503c972124e8b5a0d9ee
1 file changed
+7
-1
diff.c
+7
-1
@@ -4903,14 +4903,20 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)
4903
int abblen;
4904
const char *abbrev;
4905
4906
+ /* Do we want all 40 hex characters? */
4907
if (len == GIT_SHA1_HEXSZ)
4908
return oid_to_hex(oid);
4909
4910
+ /* An abbreviated value is fine, possibly followed by an ellipsis. */
4911
abbrev = diff_abbrev_oid(oid, len);
4912
+
4913
+ if (!print_sha1_ellipsis())
4914
+ return abbrev;
4915
+
4916
abblen = strlen(abbrev);
4917
4918
/*
4913
- * In well-behaved cases, where the abbbreviated result is the
4919
+ * In well-behaved cases, where the abbreviated result is the
4920
* same as the requested length, append three dots after the
4921
* abbreviation (hence the whole logic is limited to the case
4922
* where abblen < 37); when the actual abbreviated result is a