]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sequencer: convert to use the_hash_algo
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 18 Aug 2019 20:04:16 +0000 (20:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Aug 2019 22:04:58 +0000 (15:04 -0700)
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>
sequencer.c

index 34ebf8ed94ad7d8df6773337d31ff7d9c2c84c4a..4d25e791374fb51198c7319a6ab5eb0584c72c7b 100644 (file)
@@ -3568,7 +3568,7 @@ static int do_merge(struct repository *r,
                goto leave_merge;
        }
 
-       write_message(oid_to_hex(&merge_commit->object.oid), GIT_SHA1_HEXSZ,
+       write_message(oid_to_hex(&merge_commit->object.oid), the_hash_algo->hexsz,
                      git_path_merge_head(r), 0);
        write_message("no-ff", 5, git_path_merge_mode(r), 0);
 
@@ -4487,7 +4487,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
                char *p;
 
                strbuf_reset(&state->buf);
-               strbuf_grow(&state->buf, GIT_SHA1_HEXSZ);
+               strbuf_grow(&state->buf, GIT_MAX_HEXSZ);
                label = p = state->buf.buf;
 
                find_unique_abbrev_r(p, oid, default_abbrev);
@@ -4500,7 +4500,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
                        size_t i = strlen(p) + 1;
 
                        oid_to_hex_r(p, oid);
-                       for (; i < GIT_SHA1_HEXSZ; i++) {
+                       for (; i < the_hash_algo->hexsz; i++) {
                                char save = p[i];
                                p[i] = '\0';
                                if (!hashmap_get_from_hash(&state->labels,