summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-08-18 20:04:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-19 22:04:57 (GMT)
commit319009642c5e421915ce66436aa7a3cb94c7d11c (patch)
tree0442bb9980228a2082c4f7cdc32e512415ed53fd
parentfabec2c5c33b2623fe405c40ffcdeb838e97ed26 (diff)
downloadgit-319009642c5e421915ce66436aa7a3cb94c7d11c.zip
git-319009642c5e421915ce66436aa7a3cb94c7d11c.tar.gz
git-319009642c5e421915ce66436aa7a3cb94c7d11c.tar.bz2
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>
-rw-r--r--builtin/blame.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index b6534d4..5a0c0c2 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -460,7 +460,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
for (cnt = 0; cnt < ent->num_lines; cnt++) {
char ch;
- int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? GIT_SHA1_HEXSZ : abbrev;
+ int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? the_hash_algo->hexsz : abbrev;
if (opt & OUTPUT_COLOR_LINE) {
if (cnt > 0) {
@@ -885,6 +885,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
struct range_set ranges;
unsigned int range_i;
long anchor;
+ const int hexsz = the_hash_algo->hexsz;
setup_default_color_by_age();
git_config(git_blame_config, &output_option);
@@ -931,11 +932,11 @@ parse_done:
} else if (show_progress < 0)
show_progress = isatty(2);
- if (0 < abbrev && abbrev < GIT_SHA1_HEXSZ)
+ if (0 < abbrev && abbrev < hexsz)
/* one more abbrev length is needed for the boundary commit */
abbrev++;
else if (!abbrev)
- abbrev = GIT_SHA1_HEXSZ;
+ abbrev = hexsz;
if (revs_file && read_ancestry(revs_file))
die_errno("reading graft file '%s' failed", revs_file);