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:14 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-16 21:17:03 +0300
commit76887df01440018e1e757761fea81a4d3a676f25 (patch)
treeaf4960330e6d3e5c7c3de8b42a1f237839a2ec93 /refs.c
parent52106430dc80ea20ec2e00a6079a7bc114d36b70 (diff)
refs API: remove refs_read_ref_full() wrapper
Remove the refs_read_ref_full() wrapper in favor of migrating various refs.c API users to the underlying refs_werrres_ref_unsafe() function. A careful reading of these callers shows that the callers of this function did not care about "errno", by moving away from the refs_resolve_ref_unsafe() wrapper we can be sure that nothing relies on it anymore. 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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/refs.c b/refs.c
index 44ddbb14f1..80b85d244d 100644
--- a/refs.c
+++ b/refs.c
@@ -290,20 +290,17 @@ struct ref_filter {
void *cb_data;
};
-int refs_read_ref_full(struct ref_store *refs, const char *refname,
- int resolve_flags, struct object_id *oid, int *flags)
+int read_ref_full(const char *refname, int resolve_flags, struct object_id *oid, int *flags)
{
- if (refs_resolve_ref_unsafe(refs, refname, resolve_flags, oid, flags))
+ int ignore_errno;
+ struct ref_store *refs = get_main_ref_store(the_repository);
+
+ if (refs_werrres_ref_unsafe(refs, refname, resolve_flags,
+ oid, flags, &ignore_errno))
return 0;
return -1;
}
-int read_ref_full(const char *refname, int resolve_flags, struct object_id *oid, int *flags)
-{
- return refs_read_ref_full(get_main_ref_store(the_repository), refname,
- resolve_flags, oid, flags);
-}
-
int read_ref(const char *refname, struct object_id *oid)
{
return read_ref_full(refname, RESOLVE_REF_READING, oid, NULL);
@@ -1376,9 +1373,10 @@ int refs_head_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
{
struct object_id oid;
int flag;
+ int ignore_errno;
- if (!refs_read_ref_full(refs, "HEAD", RESOLVE_REF_READING,
- &oid, &flag))
+ if (refs_werrres_ref_unsafe(refs, "HEAD", RESOLVE_REF_READING,
+ &oid, &flag, &ignore_errno))
return fn("HEAD", &oid, flag, cb_data);
return 0;