]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-send-pack.c
tag: Check that options are only allowed in the appropriate mode
[git.git] / builtin-send-pack.c
index 2af9f2934142f55858f4b5c76deb6397ac74b9f8..301f23043262059dcb28994527334ba1909671f0 100644 (file)
@@ -132,7 +132,13 @@ static struct ref *remote_refs, **remote_tail;
 static int one_local_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
 {
        struct ref *ref;
-       int len = strlen(refname) + 1;
+       int len;
+
+       /* we already know it starts with refs/ to get here */
+       if (check_ref_format(refname + 5))
+               return 0;
+
+       len = strlen(refname) + 1;
        ref = xcalloc(1, sizeof(*ref) + len);
        hashcpy(ref->new_sha1, sha1);
        memcpy(ref->name, refname, len);