summaryrefslogtreecommitdiffstats
path: root/refs.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-15 08:50:42 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-15 16:30:51 +0200
commitf6936e62a50e8bc9e268f3396618d33e88f4df7e (patch)
treef904d0da33b78d961eb41666a1121ca3a88468ed /refs.h
parentDocumentation/glossary: define root refs as refs (diff)
downloadgit-f6936e62a50e8bc9e268f3396618d33e88f4df7e.tar.xz
git-f6936e62a50e8bc9e268f3396618d33e88f4df7e.zip
refs: rename `is_pseudoref()` to `is_root_ref()`
Rename `is_pseudoref()` to `is_root_ref()` to adapt to the newly defined terminology in our gitglossary(7). 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.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/refs.h b/refs.h
index d278775e08..d0374c3275 100644
--- a/refs.h
+++ b/refs.h
@@ -1051,7 +1051,33 @@ extern struct ref_namespace_info ref_namespace[NAMESPACE__COUNT];
*/
void update_ref_namespace(enum ref_namespace namespace, char *ref);
-int is_pseudoref(struct ref_store *refs, const char *refname);
+/*
+ * Check whether the reference is an existing root reference.
+ *
+ * A root ref is a reference that lives in the root of the reference hierarchy.
+ * These references must conform to special syntax:
+ *
+ * - Their name must be all-uppercase or underscores ("_").
+ *
+ * - Their name must end with "_HEAD".
+ *
+ * - Their name may not contain a slash.
+ *
+ * There is a special set of irregular root refs that exist due to historic
+ * reasons, only. This list shall not be expanded in the future:
+ *
+ * - AUTO_MERGE
+ *
+ * - BISECT_EXPECTED_REV
+ *
+ * - NOTES_MERGE_PARTIAL
+ *
+ * - NOTES_MERGE_REF
+ *
+ * - MERGE_AUTOSTASH
+ */
+int is_root_ref(struct ref_store *refs, const char *refname);
+
int is_headref(struct ref_store *refs, const char *refname);
#endif /* REFS_H */