diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-10-16 12:39:27 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-16 21:17:04 +0300 |
commit | f1da24ca5eeecf8931ffc08b4c8251c689c94a47 (patch) | |
tree | 4e2c0d4568e3819d669560b30401120a749be288 /refs.c | |
parent | 25a33b33424cd6c8e2c7db0f0c4b1ba01415ce38 (diff) |
refs API: post-migration API renaming [2/2]
Rename the transitory refs_werrres_ref_unsafe() function to
refs_resolve_ref_unsafe(), now that all callers of the old function
have learned to pass in a "failure_errno" parameter.
The coccinelle semantic patch added in the preceding commit works, but
I couldn't figure out how to get spatch(1) to re-flow these argument
lists (and sometimes make lines way too long), so this rename was done
with:
perl -pi -e 's/refs_werrres_ref_unsafe/refs_resolve_ref_unsafe/g' \
$(git grep -l refs_werrres_ref_unsafe -- '*.c')
But after that "make contrib/coccinelle/refs.cocci.patch" comes up
empty, so the result would have been the same. Let's remove that
transitory semantic patch file, we won't need to retain it for any
other in-flight changes, refs_werrres_ref_unsafe() only existed within
this patch series.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -270,7 +270,7 @@ char *refs_resolve_refdup(struct ref_store *refs, const char *result; int ignore_errno; - result = refs_werrres_ref_unsafe(refs, refname, resolve_flags, + result = refs_resolve_ref_unsafe(refs, refname, resolve_flags, oid, flags, &ignore_errno); return xstrdup_or_null(result); } @@ -296,7 +296,7 @@ int read_ref_full(const char *refname, int resolve_flags, struct object_id *oid, int ignore_errno; struct ref_store *refs = get_main_ref_store(the_repository); - if (refs_werrres_ref_unsafe(refs, refname, resolve_flags, + if (refs_resolve_ref_unsafe(refs, refname, resolve_flags, oid, flags, &ignore_errno)) return 0; return -1; @@ -310,7 +310,7 @@ int read_ref(const char *refname, struct object_id *oid) int refs_ref_exists(struct ref_store *refs, const char *refname) { int ignore_errno; - return !!refs_werrres_ref_unsafe(refs, refname, RESOLVE_REF_READING, + return !!refs_resolve_ref_unsafe(refs, refname, RESOLVE_REF_READING, NULL, NULL, &ignore_errno); } @@ -660,7 +660,7 @@ int expand_ref(struct repository *repo, const char *str, int len, this_result = refs_found ? &oid_from_ref : oid; strbuf_reset(&fullref); strbuf_addf(&fullref, *p, len, str); - r = refs_werrres_ref_unsafe(refs, fullref.buf, + r = refs_resolve_ref_unsafe(refs, fullref.buf, RESOLVE_REF_READING, this_result, &flag, &ignore_errno); @@ -696,7 +696,7 @@ int repo_dwim_log(struct repository *r, const char *str, int len, strbuf_reset(&path); strbuf_addf(&path, *p, len, str); - ref = refs_werrres_ref_unsafe(refs, path.buf, + ref = refs_resolve_ref_unsafe(refs, path.buf, RESOLVE_REF_READING, oid ? &hash : NULL, NULL, &ignore_errno); @@ -1383,7 +1383,7 @@ int refs_head_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data) int flag; int ignore_errno; - if (refs_werrres_ref_unsafe(refs, "HEAD", RESOLVE_REF_READING, + if (refs_resolve_ref_unsafe(refs, "HEAD", RESOLVE_REF_READING, &oid, &flag, &ignore_errno)) return fn("HEAD", &oid, flag, cb_data); @@ -1779,7 +1779,7 @@ const char *resolve_ref_unsafe(const char *refname, int resolve_flags, { int ignore_errno; - return refs_werrres_ref_unsafe(get_main_ref_store(the_repository), refname, + return refs_resolve_ref_unsafe(get_main_ref_store(the_repository), refname, resolve_flags, oid, flags, &ignore_errno); } @@ -1795,7 +1795,7 @@ int resolve_gitlink_ref(const char *submodule, const char *refname, if (!refs) return -1; - if (!refs_werrres_ref_unsafe(refs, refname, 0, oid, &flags, + if (!refs_resolve_ref_unsafe(refs, refname, 0, oid, &flags, &ignore_errno) || is_null_oid(oid)) return -1; return 0; |