diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-05-15 08:51:05 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-15 16:30:52 +0200 |
commit | f1701f279a3678e95daa5c093b8d30e815c1701b (patch) | |
tree | a70bd4fe6291bf742ca7c909e40c7f84e00d358c /refs.h | |
parent | refs: pseudorefs are no refs (diff) | |
download | git-f1701f279a3678e95daa5c093b8d30e815c1701b.tar.xz git-f1701f279a3678e95daa5c093b8d30e815c1701b.zip |
ref-filter: properly distinuish pseudo and root refs
The ref-filter interfaces currently define root refs as either a
detached HEAD or a pseudo ref. Pseudo refs aren't root refs though, so
let's properly distinguish those ref types.
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.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1080,4 +1080,22 @@ void update_ref_namespace(enum ref_namespace namespace, char *ref); */ int is_root_ref(const char *refname); +/* + * Pseudorefs are refs that have different semantics compared to + * "normal" refs. These refs can thus not be stored in the ref backend, + * but must always be accessed via the filesystem. The following refs + * are pseudorefs: + * + * - FETCH_HEAD may contain multiple object IDs, and each one of them + * carries additional metadata like where it came from. + * + * - MERGE_HEAD may contain multiple object IDs when merging multiple + * heads. + * + * Reading, writing or deleting references must consistently go either + * through the filesystem (pseudorefs) or through the reference + * backend (normal ones). + */ +int is_pseudo_ref(const char *refname); + #endif /* REFS_H */ |