Skip to content

Commit 2cd33f4

Browse files
pks-tgitster
authored andcommitted
refs: redefine special refs
Now that our list of special refs really only contains refs which have actually-special semantics, let's redefine what makes a special ref. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3f921c7 commit 2cd33f4

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

refs.c

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,39 +1839,20 @@ static int refs_read_special_head(struct ref_store *ref_store,
18391839
static int is_special_ref(const char *refname)
18401840
{
18411841
/*
1842-
* Special references get written and read directly via the filesystem
1843-
* by the subsystems that create them. Thus, they must not go through
1844-
* the reference backend but must instead be read directly. It is
1845-
* arguable whether this behaviour is sensible, or whether it's simply
1846-
* a leaky abstraction enabled by us only having a single reference
1847-
* backend implementation. But at least for a subset of references it
1848-
* indeed does make sense to treat them specially:
1842+
* Special references are refs that have different semantics compared
1843+
* to "normal" refs. These refs can thus not be stored in the ref
1844+
* backend, but must always be accessed via the filesystem. The
1845+
* following refs are special:
18491846
*
18501847
* - FETCH_HEAD may contain multiple object IDs, and each one of them
18511848
* carries additional metadata like where it came from.
18521849
*
18531850
* - MERGE_HEAD may contain multiple object IDs when merging multiple
18541851
* heads.
18551852
*
1856-
* There are some exceptions that you might expect to see on this list
1857-
* but which are handled exclusively via the reference backend:
1858-
*
1859-
* - BISECT_EXPECTED_REV
1860-
*
1861-
* - CHERRY_PICK_HEAD
1862-
*
1863-
* - HEAD
1864-
*
1865-
* - ORIG_HEAD
1866-
*
1867-
* - "rebase-apply/" and "rebase-merge/" contain all of the state for
1868-
* rebases, including some reference-like files. These are
1869-
* exclusively read and written via the filesystem and never go
1870-
* through the refdb.
1871-
*
1872-
* Writing or deleting references must consistently go either through
1873-
* the filesystem (special refs) or through the reference backend
1874-
* (normal ones).
1853+
* Reading, writing or deleting references must consistently go either
1854+
* through the filesystem (special refs) or through the reference
1855+
* backend (normal ones).
18751856
*/
18761857
static const char * const special_refs[] = {
18771858
"FETCH_HEAD",

0 commit comments

Comments
 (0)