summaryrefslogtreecommitdiff
path: root/builtin-symbolic-ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-symbolic-ref.c')
-rw-r--r--builtin-symbolic-ref.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-symbolic-ref.c b/builtin-symbolic-ref.c
index bfc78bb3f6..cafc4eba7c 100644
--- a/builtin-symbolic-ref.c
+++ b/builtin-symbolic-ref.c
@@ -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: