diff options
Diffstat (limited to 'replace-object.c')
| -rw-r--r-- | replace-object.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/replace-object.c b/replace-object.c index 03d0f1f083..3eae051074 100644 --- a/replace-object.c +++ b/replace-object.c @@ -8,27 +8,31 @@ #include "repository.h" #include "commit.h" -static int register_replace_ref(const struct reference *ref, void *cb_data) +static int register_replace_ref(const char *refname, + const char *referent UNUSED, + const struct object_id *oid, + int flag UNUSED, + void *cb_data) { struct repository *r = cb_data; /* Get sha1 from refname */ - const char *slash = strrchr(ref->name, '/'); - const char *hash = slash ? slash + 1 : ref->name; + const char *slash = strrchr(refname, '/'); + const char *hash = slash ? slash + 1 : refname; struct replace_object *repl_obj = xmalloc(sizeof(*repl_obj)); if (get_oid_hex_algop(hash, &repl_obj->original.oid, r->hash_algo)) { free(repl_obj); - warning(_("bad replace ref name: %s"), ref->name); + warning(_("bad replace ref name: %s"), refname); return 0; } /* Copy sha1 from the read ref */ - oidcpy(&repl_obj->replacement, ref->oid); + oidcpy(&repl_obj->replacement, oid); /* Register new object */ if (oidmap_put(&r->objects->replace_map, repl_obj)) - die(_("duplicate replace ref: %s"), ref->name); + die(_("duplicate replace ref: %s"), refname); return 0; } |
