summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-05 19:40:35 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-05 19:40:35 -0800
commit74b11bc3beca489502d0840e4c558a5fcc44e145 (patch)
treed6e2cf81a929f48ae694df74fcea7b8c238027d2 /path.c
parentb371922aa5b972557cd143461250a9d360882285 (diff)
parentafe5d3d516114f08d3c4289682a704f5a7889909 (diff)
downloadgit-74b11bc3beca489502d0840e4c558a5fcc44e145.tar.gz
Merge branch 'jk/head-symref'
* jk/head-symref: symbolic ref: refuse non-ref targets in HEAD validate_headref: tighten ref-matching to just branches
Diffstat (limited to 'path.c')
-rw-r--r--path.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/path.c b/path.c
index a074aea649..108d9e9599 100644
--- a/path.c
+++ b/path.c
@@ -154,7 +154,7 @@ int validate_headref(const char *path)
/* Make sure it is a "refs/.." symlink */
if (S_ISLNK(st.st_mode)) {
len = readlink(path, buffer, sizeof(buffer)-1);
- if (len >= 5 && !memcmp("refs/", buffer, 5))
+ if (len >= 11 && !memcmp("refs/heads/", buffer, 11))
return 0;
return -1;
}
@@ -178,7 +178,7 @@ int validate_headref(const char *path)
len -= 4;
while (len && isspace(*buf))
buf++, len--;
- if (len >= 5 && !memcmp("refs/", buf, 5))
+ if (len >= 11 && !memcmp("refs/heads/", buf, 11))
return 0;
}