summaryrefslogtreecommitdiffstats
path: root/refs.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-06 07:29:01 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-06 18:04:31 +0200
commit318efb966bc9b246703152f77cadd4e407de7cd9 (patch)
treeb920e69a5cebb0599f60f02b4207cd630d632a60 /refs.h
parentsetup: unset ref storage when reinitializing repository version (diff)
downloadgit-318efb966bc9b246703152f77cadd4e407de7cd9.tar.xz
git-318efb966bc9b246703152f77cadd4e407de7cd9.zip
refs: convert ref storage format to an enum
The ref storage format is tracked as a simple unsigned integer, which makes it harder than necessary to discover what that integer actually is or where its values are defined. Convert the ref storage format to instead be an enum. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/refs.h b/refs.h
index fe7f0db35e..a7afa9bede 100644
--- a/refs.h
+++ b/refs.h
@@ -11,8 +11,14 @@ struct string_list;
struct string_list_item;
struct worktree;
-unsigned int ref_storage_format_by_name(const char *name);
-const char *ref_storage_format_to_name(unsigned int ref_storage_format);
+enum ref_storage_format {
+ REF_STORAGE_FORMAT_UNKNOWN,
+ REF_STORAGE_FORMAT_FILES,
+ REF_STORAGE_FORMAT_REFTABLE,
+};
+
+enum ref_storage_format ref_storage_format_by_name(const char *name);
+const char *ref_storage_format_to_name(enum ref_storage_format ref_storage_format);
/*
* Resolve a reference, recursively following symbolic refererences.