@matheusbsbs / matheus-bagliano / commits / 222b167386
Fork 0

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

This reverts commit b229d18a809c169314b7f0d048dc5a7632e8f916, at least until we figure out how to work better with TopGit that points HEAD to refs/top-bases/ hierarchy.

Junio C Hamano committed Feb 12, 2009 at 13:02 UTC 222b1673860bba6c75895ce3e2d1467fb878fa2a
1 file changed +2 -2
path.c
+2 -2
@@ -154,7 +154,7 @@ int validate_headref(const char *path)
154 /* Make sure it is a "refs/.." symlink */
155 if (S_ISLNK(st.st_mode)) {
156 len = readlink(path, buffer, sizeof(buffer)-1);
157 - if (len >= 11 && !memcmp("refs/heads/", buffer, 11))
157 + if (len >= 5 && !memcmp("refs/", buffer, 5))
158 return 0;
159 return -1;
160 }
@@ -178,7 +178,7 @@ int validate_headref(const char *path)
178 len -= 4;
179 while (len && isspace(*buf))
180 buf++, len--;
181 - if (len >= 11 && !memcmp("refs/heads/", buf, 11))
181 + if (len >= 5 && !memcmp("refs/", buf, 5))
182 return 0;
183 }
184