Skip to content

Commit 99cf4d6

Browse files
pks-tgitster
authored andcommitted
replace-object: use hash algorithm from passed-in repository
In `register_replace_ref()`, we pass in a repository but then use `get_oid_hex()` to parse passed-in object IDs, which implicitly uses `the_repository`. Fix this by using the hash algorithm from the passed-in repository instead. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 58650be commit 99cf4d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

replace-object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static int register_replace_ref(const char *refname,
2020
const char *hash = slash ? slash + 1 : refname;
2121
struct replace_object *repl_obj = xmalloc(sizeof(*repl_obj));
2222

23-
if (get_oid_hex(hash, &repl_obj->original.oid)) {
23+
if (get_oid_hex_algop(hash, &repl_obj->original.oid, r->hash_algo)) {
2424
free(repl_obj);
2525
warning(_("bad replace ref name: %s"), refname);
2626
return 0;

0 commit comments

Comments
 (0)