aboutsummaryrefslogtreecommitdiffstats
path: root/refs/refs-internal.h
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-11-22 13:28:44 +0100
committerJunio C Hamano <gitster@pobox.com>2024-11-25 11:46:35 +0900
commit8102d10ff8317c1e0ba5afb3a41b6a2bc523ff97 (patch)
tree9bbd2ef07f0b60889172b6147f09dec77a96749c /refs/refs-internal.h
parentt/t5505-remote: test failure of set-head (diff)
downloadgit-8102d10ff8317c1e0ba5afb3a41b6a2bc523ff97.tar.gz
git-8102d10ff8317c1e0ba5afb3a41b6a2bc523ff97.zip
refs: standardize output of refs_read_symbolic_ref
When the symbolic reference we want to read with refs_read_symbolic_ref is actually not a symbolic reference, the files and the reftable backends return different values (1 and -1 respectively). Standardize the returned values so that 0 is success, -1 is a generic error and -2 is that the reference was actually non-symbolic. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/refs-internal.h')
-rw-r--r--refs/refs-internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 2313c830d8..1399fee61c 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -673,6 +673,11 @@ struct ref_storage_be {
ref_iterator_begin_fn *iterator_begin;
read_raw_ref_fn *read_raw_ref;
+
+ /*
+ * Please refer to `refs_read_symbolic_ref()` for the expected
+ * behaviour.
+ */
read_symbolic_ref_fn *read_symbolic_ref;
reflog_iterator_begin_fn *reflog_iterator_begin;