summaryrefslogtreecommitdiff
path: root/builtin-send-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-02 00:15:22 -0700
committerJunio C Hamano <gitster@pobox.com>2008-11-02 00:15:22 -0700
commitaebd173ffa7a4e67447f0157a14abde7767c54e9 (patch)
tree2c3c660e441d93120a42cfac5c909dcbd2f5b275 /builtin-send-pack.c
parentf6576f4c0c6fa3b2d979faf28936c09480dedaab (diff)
parent1a9016aae5aa8c468bb2d8d5dd16303d5c005869 (diff)
downloadgit-aebd173ffa7a4e67447f0157a14abde7767c54e9.tar.gz
Merge branch 'maint'
* maint: Start 1.6.0.4 cycle add instructions on how to send patches to the mailing list with Gmail Documentation/gitattributes: Add subsection header for each attribute git send-email: avoid leaking directory file descriptors. send-pack: do not send out single-level refs such as refs/stash fix overlapping memcpy in normalize_absolute_path pack-objects: avoid reading uninitalized data correct cache_entry allocation Conflicts: RelNotes
Diffstat (limited to 'builtin-send-pack.c')
-rw-r--r--builtin-send-pack.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 910db92b62..d68ce2d0e3 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -140,7 +140,13 @@ static struct ref *remote_refs, **remote_tail;
static int one_local_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
{
struct ref *ref;
- int len = strlen(refname) + 1;
+ int len;
+
+ /* we already know it starts with refs/ to get here */
+ if (check_ref_format(refname + 5))
+ return 0;
+
+ len = strlen(refname) + 1;
ref = xcalloc(1, sizeof(*ref) + len);
hashcpy(ref->new_sha1, sha1);
memcpy(ref->name, refname, len);