diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-02-05 19:40:35 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-05 19:40:35 -0800 |
commit | 74b11bc3beca489502d0840e4c558a5fcc44e145 (patch) | |
tree | d6e2cf81a929f48ae694df74fcea7b8c238027d2 /path.c | |
parent | b371922aa5b972557cd143461250a9d360882285 (diff) | |
parent | afe5d3d516114f08d3c4289682a704f5a7889909 (diff) | |
download | git-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |