diff options
author | Philip Kelley <phkelley@hotmail.com> | 2012-11-28 11:42:37 -0500 |
---|---|---|
committer | Philip Kelley <phkelley@hotmail.com> | 2012-11-28 11:42:37 -0500 |
commit | 613d5eb9391d6cc33c91f4dc9cdb5ede1885dc72 (patch) | |
tree | bd94a2a5ea154a3849114575368b7531f0d45024 /src/pack-objects.c | |
parent | 693021262ba0eeac2923bbce1b2262717019c807 (diff) | |
download | libgit2-613d5eb9391d6cc33c91f4dc9cdb5ede1885dc72.tar.gz |
Push! By schu, phkelley, and congyiwu, et al
Diffstat (limited to 'src/pack-objects.c')
-rw-r--r-- | src/pack-objects.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c index 008d8f288..44ad3fd98 100644 --- a/src/pack-objects.c +++ b/src/pack-objects.c @@ -604,12 +604,6 @@ on_error: return -1; } -static int send_pack_file(void *buf, size_t size, void *data) -{ - gitno_socket *s = (gitno_socket *)data; - return gitno_send(s, buf, size, 0); -} - static int write_pack_buf(void *buf, size_t size, void *data) { git_buf *b = (git_buf *)data; @@ -1233,12 +1227,6 @@ static int prepare_pack(git_packbuilder *pb) #define PREPARE_PACK if (prepare_pack(pb) < 0) { return -1; } -int git_packbuilder_send(git_packbuilder *pb, gitno_socket *s) -{ - PREPARE_PACK; - return write_pack(pb, &send_pack_file, s); -} - int git_packbuilder_foreach(git_packbuilder *pb, int (*cb)(void *buf, size_t size, void *payload), void *payload) { PREPARE_PACK; @@ -1264,6 +1252,10 @@ static int cb_tree_walk(const char *root, const git_tree_entry *entry, void *pay git_packbuilder *pb = payload; git_buf buf = GIT_BUF_INIT; + /* A commit inside a tree represents a submodule commit and should be skipped. */ + if(git_tree_entry_type(entry) == GIT_OBJ_COMMIT) + return 0; + git_buf_puts(&buf, root); git_buf_puts(&buf, git_tree_entry_name(entry)); |