builtin/blame: switch uses of GIT_SHA1_HEXSZ to the_hash_algo
Switch several uses of GIT_SHA1_HEXSZ to the_hash_algo. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Aug 18, 2019 at 20:04 UTC
319009642c5e421915ce66436aa7a3cb94c7d11c
1 file changed
+4
-3
builtin/blame.c
+4
-3
@@ -460,7 +460,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
460
461
for (cnt = 0; cnt < ent->num_lines; cnt++) {
462
char ch;
463
- int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? GIT_SHA1_HEXSZ : abbrev;
463
+ int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? the_hash_algo->hexsz : abbrev;
464
465
if (opt & OUTPUT_COLOR_LINE) {
466
if (cnt > 0) {
@@ -885,6 +885,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
885
struct range_set ranges;
886
unsigned int range_i;
887
long anchor;
888
+ const int hexsz = the_hash_algo->hexsz;
889
890
setup_default_color_by_age();
891
git_config(git_blame_config, &output_option);
@@ -931,11 +932,11 @@ parse_done:
932
} else if (show_progress < 0)
933
show_progress = isatty(2);
934
934
- if (0 < abbrev && abbrev < GIT_SHA1_HEXSZ)
935
+ if (0 < abbrev && abbrev < hexsz)
936
/* one more abbrev length is needed for the boundary commit */
937
abbrev++;
938
else if (!abbrev)
938
- abbrev = GIT_SHA1_HEXSZ;
939
+ abbrev = hexsz;
940
941
if (revs_file && read_ancestry(revs_file))
942
die_errno("reading graft file '%s' failed", revs_file);