Code

Rework pretty_print_commit to use strbufs instead of custom buffers.
[git.git] / fetch.c
diff --git a/fetch.c b/fetch.c
index dda33e548b65e79e22de8a84ab4d67ef13387a05..dd6ed9e41cf7ebbd304568f422da0b14a5e01d27 100644 (file)
--- a/fetch.c
+++ b/fetch.c
@@ -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)
@@ -215,7 +218,7 @@ int pull_targets_stdin(char ***target, const char ***write_ref)
        int targets = 0, targets_alloc = 0;
        struct strbuf buf;
        *target = NULL; *write_ref = NULL;
-       strbuf_init(&buf);
+       strbuf_init(&buf, 0);
        while (1) {
                char *rf_one = NULL;
                char *tg_one;