builtin/merge: switch to use the_hash_algo
[gitweb.git] / builtin / update-index.c
index 031cef5229cb7fb5d94d8a8184933a2f90af0f72..3206c5ad45910643f8e75d16b6b0af08f9ac1b00 100644 (file)
@@ -827,6 +827,7 @@ static int parse_new_style_cacheinfo(const char *arg,
 {
        unsigned long ul;
        char *endp;
+       const char *p;
 
        if (!arg)
                return -1;
@@ -837,9 +838,9 @@ static int parse_new_style_cacheinfo(const char *arg,
                return -1; /* not a new-style cacheinfo */
        *mode = ul;
        endp++;
-       if (get_oid_hex(endp, oid) || endp[GIT_SHA1_HEXSZ] != ',')
+       if (parse_oid_hex(endp, oid, &p) || *p != ',')
                return -1;
-       *path = endp + GIT_SHA1_HEXSZ + 1;
+       *path = p + 1;
        return 0;
 }