sequencer: convert to use the_hash_algo
Convert several uses of GIT_SHA1_HEXSZ constants to be references 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
4439c7a360a23c39e6dea3c9aae080c3c64eb6b6
1 file changed
+3
-3
sequencer.c
+3
-3
@@ -3568,7 +3568,7 @@ static int do_merge(struct repository *r,
3568
goto leave_merge;
3569
}
3570
3571
- write_message(oid_to_hex(&merge_commit->object.oid), GIT_SHA1_HEXSZ,
3571
+ write_message(oid_to_hex(&merge_commit->object.oid), the_hash_algo->hexsz,
3572
git_path_merge_head(r), 0);
3573
write_message("no-ff", 5, git_path_merge_mode(r), 0);
3574
@@ -4487,7 +4487,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
4487
char *p;
4488
4489
strbuf_reset(&state->buf);
4490
- strbuf_grow(&state->buf, GIT_SHA1_HEXSZ);
4490
+ strbuf_grow(&state->buf, GIT_MAX_HEXSZ);
4491
label = p = state->buf.buf;
4492
4493
find_unique_abbrev_r(p, oid, default_abbrev);
@@ -4500,7 +4500,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
4500
size_t i = strlen(p) + 1;
4501
4502
oid_to_hex_r(p, oid);
4503
- for (; i < GIT_SHA1_HEXSZ; i++) {
4503
+ for (; i < the_hash_algo->hexsz; i++) {
4504
char save = p[i];
4505
p[i] = '\0';
4506
if (!hashmap_get_from_hash(&state->labels,