diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-11-04 07:31:26 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-11-04 07:31:26 -0800 |
| commit | 8c6e6b27379b98269620f5f20397425ba358a1bb (patch) | |
| tree | f5c35ea7c977e5ee3df8a3cbfb4b29a732d66e1a /replace-object.c | |
| parent | Revert "Merge branch 'kn/refs-optim-cleanup' into next" (diff) | |
| download | git-8c6e6b27379b98269620f5f20397425ba358a1bb.tar.gz git-8c6e6b27379b98269620f5f20397425ba358a1bb.zip | |
Revert "Merge branch 'ps/ref-peeled-tags' into next"
This reverts commit 8ac48a10de61267858d66383c34833e55a5e9d02, reversing
changes made to 9ab444edfb825dfbc555b3d7916df03071db94c3.
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; } |
