Skip to content

Commit 222b167

Browse files
committed
Revert "validate_headref: tighten ref-matching to just branches"
This reverts commit b229d18, at least until we figure out how to work better with TopGit that points HEAD to refs/top-bases/ hierarchy.
1 parent a8344ab commit 222b167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

path.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ int validate_headref(const char *path)
154154
/* Make sure it is a "refs/.." symlink */
155155
if (S_ISLNK(st.st_mode)) {
156156
len = readlink(path, buffer, sizeof(buffer)-1);
157-
if (len >= 11 && !memcmp("refs/heads/", buffer, 11))
157+
if (len >= 5 && !memcmp("refs/", buffer, 5))
158158
return 0;
159159
return -1;
160160
}
@@ -178,7 +178,7 @@ int validate_headref(const char *path)
178178
len -= 4;
179179
while (len && isspace(*buf))
180180
buf++, len--;
181-
if (len >= 11 && !memcmp("refs/heads/", buf, 11))
181+
if (len >= 5 && !memcmp("refs/", buf, 5))
182182
return 0;
183183
}
184184

0 commit comments

Comments
 (0)