Merge branch 'sb/maint-rebase' into maint
[gitweb.git] / builtin-fast-export.c
old mode 100755 (executable)
new mode 100644 (file)
index e1c5630..d0a462f
@@ -188,6 +188,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
        mark_object(&commit->object);
        if (!is_encoding_utf8(encoding))
                reencoded = reencode_string(message, "UTF-8", encoding);
+       if (!commit->parents)
+               printf("reset %s\n", (const char*)commit->util);
        printf("commit %s\nmark :%d\n%.*s\n%.*s\ndata %u\n%s",
               (const char *)commit->util, last_idnum,
               (int)(author_end - author), author,
@@ -204,14 +206,10 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
                        continue;
                if (i == 0)
                        printf("from :%d\n", mark);
-               else if (i == 1)
-                       printf("merge :%d", mark);
                else
-                       printf(" :%d", mark);
+                       printf("merge :%d\n", mark);
                i++;
        }
-       if (i > 1)
-               printf("\n");
 
        log_tree_diff_flush(rev);
        rev->diffopt.output_format = saved_output_format;
@@ -372,7 +370,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
        };
 
        /* we handle encodings */
-       git_config(git_default_config);
+       git_config(git_default_config, NULL);
 
        init_revisions(&revs, prefix);
        argc = setup_revisions(argc, argv, &revs, NULL);