Merge branch 'sb/am-tests'
[gitweb.git] / builtin-fast-export.c
index f741df522014b9495f18cf13c2e01382da71c41d..1dfc01e8f009968ef5d6118bffed7818e736576c 100755 (executable)
@@ -123,7 +123,7 @@ static void show_filemodify(struct diff_queue_struct *q,
                        printf("D %s\n", spec->path);
                else {
                        struct object *object = lookup_object(spec->sha1);
-                       printf("M 0%06o :%d %s\n", spec->mode,
+                       printf("M %06o :%d %s\n", spec->mode,
                               get_object_mark(object), spec->path);
                }
        }
@@ -196,8 +196,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 +204,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 +368,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);