submodule: warn about non-submodules
[gitweb.git] / builtin-symbolic-ref.c
index b49bdb6900f2c49b55880f9f220597bf3f156810..cafc4eba7cc0f8e2c89d49403b56bb746fe14545 100644 (file)
@@ -4,7 +4,7 @@
 #include "parse-options.h"
 
 static const char * const git_symbolic_ref_usage[] = {
-       "git-symbolic-ref [options] name [ref]",
+       "git symbolic-ref [options] name [ref]",
        NULL
 };
 
@@ -44,6 +44,9 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
                check_symref(argv[0], quiet);
                break;
        case 2:
+               if (!strcmp(argv[0], "HEAD") &&
+                   prefixcmp(argv[1], "refs/heads/"))
+                       die("Refusing to point HEAD outside of refs/heads/");
                create_symref(argv[0], argv[1], msg);
                break;
        default: