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>
Johannes Schindelin committed
Feb 14, 2008 at 23:32 UTC
1bbeb4c6905b18446485413d98f4b75e56a6830c
1 file changed
+11
-4
http-push.c
+11
-4
@@ -1634,12 +1634,19 @@ static struct object_list **process_tree(struct tree *tree,
1634
1635
init_tree_desc(&desc, tree->buffer, tree->size);
1636
1637
- while (tree_entry(&desc, &entry)) {
1638
- if (S_ISDIR(entry.mode))
1637
+ while (tree_entry(&desc, &entry))
1638
+ switch (object_type(entry.mode)) {
1639
+ case OBJ_TREE:
1640
p = process_tree(lookup_tree(entry.sha1), p, &me, name);
1640
- else
1641
+ break;
1642
+ case OBJ_BLOB:
1643
p = process_blob(lookup_blob(entry.sha1), p, &me, name);
1642
- }
1644
+ break;
1645
+ default:
1646
+ /* Subproject commit - not in this repository */
1647
+ break;
1648
+ }
1649
+
1650
free(tree->buffer);
1651
tree->buffer = NULL;
1652
return p;