summaryrefslogtreecommitdiffstats
path: root/replace-object.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-14 08:50:51 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-14 19:26:34 +0200
commit99cf4d6d35c7e98dde958e75ff39cd01f2088506 (patch)
tree0010a59a311b2586b7409dd16dc78d141e348749 /replace-object.c
parentprotocol-caps: use hash algorithm from passed-in repository (diff)
downloadgit-99cf4d6d35c7e98dde958e75ff39cd01f2088506.tar.xz
git-99cf4d6d35c7e98dde958e75ff39cd01f2088506.zip
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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'replace-object.c')
-rw-r--r--replace-object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/replace-object.c b/replace-object.c
index 73f5acbcd9..59252d565e 100644
--- a/replace-object.c
+++ b/replace-object.c
@@ -20,7 +20,7 @@ static int register_replace_ref(const char *refname,
const char *hash = slash ? slash + 1 : refname;
struct replace_object *repl_obj = xmalloc(sizeof(*repl_obj));
- if (get_oid_hex(hash, &repl_obj->original.oid)) {
+ if (get_oid_hex_algop(hash, &repl_obj->original.oid, r->hash_algo)) {
free(repl_obj);
warning(_("bad replace ref name: %s"), refname);
return 0;