Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-10-16 12:39:24 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-16 21:17:04 +0300
commit6582bd31e3f3fa6cfb16fae0cd31036081c14a0a (patch)
treeae9d9ca40d1c3808418e70680955a2df6b70f6de /refs.c
parented90f04155df1ec757b241ae3f45889c05efae26 (diff)
refs API: make expand_ref() & repo_dwim_log() not set errno
The use of these two is rather trivial, and it's easy to see none of their callers care about errno. So let's move them from refs_resolve_ref_unsafe() to refs_resolve_ref_unsafe_with_errno(), these were the last two callers, so we can get rid of that wrapper function. 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.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/refs.c b/refs.c
index b563729782..43fe9e6d89 100644
--- a/refs.c
+++ b/refs.c
@@ -654,13 +654,16 @@ int expand_ref(struct repository *repo, const char *str, int len,
struct object_id oid_from_ref;
struct object_id *this_result;
int flag;
+ struct ref_store *refs = get_main_ref_store(repo);
+ int ignore_errno;
this_result = refs_found ? &oid_from_ref : oid;
strbuf_reset(&fullref);
strbuf_addf(&fullref, *p, len, str);
- r = refs_resolve_ref_unsafe(get_main_ref_store(repo),
- fullref.buf, RESOLVE_REF_READING,
- this_result, &flag);
+ r = refs_werrres_ref_unsafe(refs, fullref.buf,
+ RESOLVE_REF_READING,
+ this_result, &flag,
+ &ignore_errno);
if (r) {
if (!refs_found++)
*ref = xstrdup(r);
@@ -689,12 +692,14 @@ int repo_dwim_log(struct repository *r, const char *str, int len,
for (p = ref_rev_parse_rules; *p; p++) {
struct object_id hash;
const char *ref, *it;
+ int ignore_errno;
strbuf_reset(&path);
strbuf_addf(&path, *p, len, str);
- ref = refs_resolve_ref_unsafe(refs, path.buf,
+ ref = refs_werrres_ref_unsafe(refs, path.buf,
RESOLVE_REF_READING,
- oid ? &hash : NULL, NULL);
+ oid ? &hash : NULL, NULL,
+ &ignore_errno);
if (!ref)
continue;
if (refs_reflog_exists(refs, path.buf))