Revert "validate_headref: tighten ref-matching to just branches"

This reverts commit b229d18a80, at least
until we figure out how to work better with TopGit that points HEAD to
refs/top-bases/ hierarchy.
This commit is contained in:
Junio C Hamano 2009-02-12 13:02:09 -08:00
parent a8344abe0f
commit 222b167386

4
path.c
View File

@ -154,7 +154,7 @@ int validate_headref(const char *path)
/* Make sure it is a "refs/.." symlink */ /* Make sure it is a "refs/.." symlink */
if (S_ISLNK(st.st_mode)) { if (S_ISLNK(st.st_mode)) {
len = readlink(path, buffer, sizeof(buffer)-1); len = readlink(path, buffer, sizeof(buffer)-1);
if (len >= 11 && !memcmp("refs/heads/", buffer, 11)) if (len >= 5 && !memcmp("refs/", buffer, 5))
return 0; return 0;
return -1; return -1;
} }
@ -178,7 +178,7 @@ int validate_headref(const char *path)
len -= 4; len -= 4;
while (len && isspace(*buf)) while (len && isspace(*buf))
buf++, len--; buf++, len--;
if (len >= 11 && !memcmp("refs/heads/", buf, 11)) if (len >= 5 && !memcmp("refs/", buf, 5))
return 0; return 0;
} }