projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git-fetch-pack: Do not use git-rev-list
[git.git]
/
receive-pack.c
diff --git
a/receive-pack.c
b/receive-pack.c
index
1ef0c13
..
8f157bc
100644
(file)
--- a/
receive-pack.c
+++ b/
receive-pack.c
@@
-24,7
+24,7
@@
struct command {
unsigned char updated;
unsigned char old_sha1[20];
unsigned char new_sha1[20];
unsigned char updated;
unsigned char old_sha1[20];
unsigned char new_sha1[20];
- char ref_name[];
+ char ref_name[
0
];
};
static struct command *commands = NULL;
};
static struct command *commands = NULL;
@@
-95,6
+95,10
@@
static int update(const char *name,
char new_hex[60], *old_hex, *lock_name;
int newfd, namelen, written;
char new_hex[60], *old_hex, *lock_name;
int newfd, namelen, written;
+ if (!strncmp(name, "refs/", 5) && check_ref_format(name + 5))
+ return error("refusing to create funny ref '%s' locally",
+ name);
+
namelen = strlen(name);
lock_name = xmalloc(namelen + 10);
memcpy(lock_name, name, namelen);
namelen = strlen(name);
lock_name = xmalloc(namelen + 10);
memcpy(lock_name, name, namelen);