Skip to contentSkip to conversation

Ignore submodule commits when fetching over dumb protocols

PATCH In review Sven Verdoolaege 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Ignore submodule commits when fetching over dumb protocols

Without this patch, the code would look for the submodule commits in the superproject and (needlessly) fail when it couldn't find them.

---
 fetch.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fetch.c +3 -0
index dda33e5..811be87 100644
@@ -46,6 +46,9 @@ static int process_tree(struct tree *tree)
 	while (tree_entry(&desc, &entry)) {
 		struct object *obj = NULL;
 
+		/* submodule commits are not stored in the superproject */
+		if (S_ISGITLINK(entry.mode))
+			continue;
 		if (S_ISDIR(entry.mode)) {
 			struct tree *tree = lookup_tree(entry.sha1);
 			if (tree)
Signature · 1 line
1.5.2.2.549.gaeb59
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Sven Verdoolaege

Without this patch, the code would look for the submodule commits in the superproject and (needlessly) fail when it couldn't find them.

This should probably be put in the maintenance branch, since I think we've tried to make sure that the current 1.5.x series plumbing can handle superproject data even if it doesn't then have the porcelain to make it all easy..

Linus

#2 lore raw
Quoted 6 lines · Linus Torvalds

This should probably be put in the maintenance branch, since I think we've tried to make sure that the current 1.5.x series plumbing can handle superproject data even if it doesn't then have the porcelain to make it all easy..

Thanks, both.