]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refspec: make hash size independent
authorbrian m. carlson <sandals@crustytoothpaste.net>
Tue, 19 Feb 2019 00:05:21 +0000 (00:05 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2019 02:57:39 +0000 (11:57 +0900)
Switch a use of GIT_SHA1_HEXSZ to use the_hash_algo.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refspec.c

index f529092fd6d9ba0474fd21b31d72c117794e640d..9a9bf21934afb74e34b8cef1042860824f4c7282 100644 (file)
--- a/refspec.c
+++ b/refspec.c
@@ -72,7 +72,7 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet
                /* LHS */
                if (!*item->src)
                        ; /* empty is ok; it means "HEAD" */
-               else if (llen == GIT_SHA1_HEXSZ && !get_oid_hex(item->src, &unused))
+               else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused))
                        item->exact_sha1 = 1; /* ok */
                else if (!check_refname_format(item->src, flags))
                        ; /* valid looking ref is ok */