From f1da24ca5eeecf8931ffc08b4c8251c689c94a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 16 Oct 2021 11:39:27 +0200 Subject: refs API: post-migration API renaming [2/2] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- refs.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'refs.c') diff --git a/refs.c b/refs.c index 4e06745c97..cd9b8bb114 100644 --- a/refs.c +++ b/refs.c @@ -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; -- cgit v1.2.1