summaryrefslogtreecommitdiff
path: root/clone-pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'clone-pack.c')
-rw-r--r--clone-pack.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clone-pack.c b/clone-pack.c
index 9a3371e..0ea7e7f 100644
--- a/clone-pack.c
+++ b/clone-pack.c
@@ -36,6 +36,12 @@ static void write_one_ref(struct ref *ref)
int fd;
char *hex;
+ if (!strncmp(ref->name, "refs/", 5) &&
+ check_ref_format(ref->name + 5)) {
+ error("refusing to create funny ref '%s' locally", ref->name);
+ return;
+ }
+
if (safe_create_leading_directories(path))
die("unable to create leading directory for %s", ref->name);
fd = open(path, O_CREAT | O_EXCL | O_WRONLY, 0666);