X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin-fast-export.c;h=d0a462ff8b3760a4a21d9a72339a02891a5b4aef;hb=e4bffb5a1d9ab3c9c0ef0541a395d47516480d97;hp=724cff35d37a42daa85edd41b97f0ef20d01f684;hpb=274d9d329444705ba771e548352918699e6bb557;p=git.git diff --git a/builtin-fast-export.c b/builtin-fast-export.c old mode 100755 new mode 100644 index 724cff35d..d0a462ff8 --- a/builtin-fast-export.c +++ b/builtin-fast-export.c @@ -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, @@ -196,8 +198,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev) ? strlen(reencoded) : message ? strlen(message) : 0), reencoded ? reencoded : message ? message : ""); - if (reencoded) - free(reencoded); + free(reencoded); for (i = 0, p = commit->parents; p; p = p->next) { int mark = get_object_mark(&p->item->object); @@ -205,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; @@ -373,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); @@ -383,7 +380,8 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) get_tags_and_duplicates(&revs.pending, &extra_refs); - prepare_revision_walk(&revs); + if (prepare_revision_walk(&revs)) + die("revision walk setup failed"); revs.diffopt.format_callback = show_filemodify; DIFF_OPT_SET(&revs.diffopt, RECURSIVE); while ((commit = get_revision(&revs))) {