summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-02-14 23:32:32 +0000
committerJunio C Hamano <gitster@pobox.com>2008-02-15 23:21:56 -0800
commit1bbeb4c6905b18446485413d98f4b75e56a6830c (patch)
tree894fd2ccd6422c19c2fbf654f51fd56bb81f335a /http-push.c
parentadd8e8cee5054734cb19d918f83bcee649aab326 (diff)
downloadgit-1bbeb4c6905b18446485413d98f4b75e56a6830c.tar.gz
http-push: do not get confused by submodules
When encountering submodules in a tree, http-push should not try sending the respective object. Instead, it should ignore it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/http-push.c b/http-push.c
index 386b806f3e..14ef652ca7 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1634,12 +1634,19 @@ static struct object_list **process_tree(struct tree *tree,
init_tree_desc(&desc, tree->buffer, tree->size);
- while (tree_entry(&desc, &entry)) {
- if (S_ISDIR(entry.mode))
+ while (tree_entry(&desc, &entry))
+ switch (object_type(entry.mode)) {
+ case OBJ_TREE:
p = process_tree(lookup_tree(entry.sha1), p, &me, name);
- else
+ break;
+ case OBJ_BLOB:
p = process_blob(lookup_blob(entry.sha1), p, &me, name);
- }
+ break;
+ default:
+ /* Subproject commit - not in this repository */
+ break;
+ }
+
free(tree->buffer);
tree->buffer = NULL;
return p;