Reset possible helper before reusing remote structure
[gitweb.git] / builtin-symbolic-ref.c
index cafc4eba7cc0f8e2c89d49403b56bb746fe14545..ca855a5eb239f4dadccd53369e38db4e78b1d13f 100644 (file)
@@ -36,7 +36,8 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
        };
 
        git_config(git_default_config, NULL);
-       argc = parse_options(argc, argv, options, git_symbolic_ref_usage, 0);
+       argc = parse_options(argc, argv, prefix, options,
+                            git_symbolic_ref_usage, 0);
        if (msg &&!*msg)
                die("Refusing to perform update with empty message");
        switch (argc) {
@@ -45,8 +46,8 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
                break;
        case 2:
                if (!strcmp(argv[0], "HEAD") &&
-                   prefixcmp(argv[1], "refs/heads/"))
-                       die("Refusing to point HEAD outside of refs/heads/");
+                   prefixcmp(argv[1], "refs/"))
+                       die("Refusing to point HEAD outside of refs/");
                create_symref(argv[0], argv[1], msg);
                break;
        default: