diff mbox series

[v4,3/3] Make HEAD a PSEUDOREF rather than PER_WORKTREE.

Message ID 358d34df0769eff54bc293f473d6e4dedd912563.1595867147.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit 55dd8b9108679da122d2c69fda3b9413651af4d7
Headers show
Series Remove special casing for PSEUDOREF updates | expand

Commit Message

Philippe Blain via GitGitGadget July 27, 2020, 4:25 p.m. UTC
From: Han-Wen Nienhuys <hanwen@google.com>

This is consistent with the definition of REF_TYPE_PSEUDOREF
(uppercase in the root ref namespace).

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 refs.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/refs.c b/refs.c
index d676acb1f4..5cd71f711f 100644
--- a/refs.c
+++ b/refs.c
@@ -708,10 +708,9 @@  int dwim_log(const char *str, int len, struct object_id *oid, char **log)
 
 static int is_per_worktree_ref(const char *refname)
 {
-	return !strcmp(refname, "HEAD") ||
-		starts_with(refname, "refs/worktree/") ||
-		starts_with(refname, "refs/bisect/") ||
-		starts_with(refname, "refs/rewritten/");
+	return starts_with(refname, "refs/worktree/") ||
+	       starts_with(refname, "refs/bisect/") ||
+	       starts_with(refname, "refs/rewritten/");
 }
 
 static int is_pseudoref_syntax(const char *refname)