X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=path.c;h=4b9107fed10c1f3551acf1f14d2ba5d1ba8a0b84;hb=7fcda9201e192413c2e63fe35ce6664dbc81705d;hp=dd22370e8e5cb932f9c8ce8756c154073771b35b;hpb=f1c8a48a2de69bfc9837c53f2c52ffbe7239dc3e;p=git.git diff --git a/path.c b/path.c index dd22370e8..4b9107fed 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 >= 11 && !memcmp("refs/heads/", buffer, 11)) + if (len >= 5 && !memcmp("refs/", buffer, 5)) return 0; return -1; } @@ -178,7 +178,7 @@ int validate_headref(const char *path) len -= 4; while (len && isspace(*buf)) buf++, len--; - if (len >= 11 && !memcmp("refs/heads/", buf, 11)) + if (len >= 5 && !memcmp("refs/", buf, 5)) return 0; }