diff --git a/builtin-symbolic-ref.c b/builtin-symbolic-ref.c
index b49bdb6900f2c49b55880f9f220597bf3f156810..ca855a5eb239f4dadccd53369e38db4e78b1d13f 100644 (file)
--- a/builtin-symbolic-ref.c
+++ b/builtin-symbolic-ref.c
#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
};
};
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) {
check_symref(argv[0], quiet);
break;
case 2:
+ if (!strcmp(argv[0], "HEAD") &&
+ prefixcmp(argv[1], "refs/"))
+ die("Refusing to point HEAD outside of refs/");
create_symref(argv[0], argv[1], msg);
break;
default: