contrib/buildsystems: handle quoted spaces in filenames
[gitweb.git] / builtin / commit-graph.c
index 2a1c4d701fcb50605b46c441dd16729f8b7c6605..d8efa5bab276a816bef48e9cb3891ccc0cb81aad 100644 (file)
@@ -142,6 +142,7 @@ static int graph_write(int argc, const char **argv)
        struct string_list *commit_hex = NULL;
        struct string_list lines;
        int result = 0;
+       unsigned int flags = COMMIT_GRAPH_PROGRESS;
 
        static struct option builtin_commit_graph_write_options[] = {
                OPT_STRING(0, "object-dir", &opts.obj_dir,
@@ -166,11 +167,13 @@ static int graph_write(int argc, const char **argv)
                die(_("use at most one of --reachable, --stdin-commits, or --stdin-packs"));
        if (!opts.obj_dir)
                opts.obj_dir = get_object_directory();
+       if (opts.append)
+               flags |= COMMIT_GRAPH_APPEND;
 
        read_replace_refs = 0;
 
        if (opts.reachable)
-               return write_commit_graph_reachable(opts.obj_dir, opts.append, 1);
+               return write_commit_graph_reachable(opts.obj_dir, flags);
 
        string_list_init(&lines, 0);
        if (opts.stdin_packs || opts.stdin_commits) {
@@ -190,8 +193,7 @@ static int graph_write(int argc, const char **argv)
        if (write_commit_graph(opts.obj_dir,
                               pack_indexes,
                               commit_hex,
-                              opts.append,
-                              1))
+                              flags))
                result = 1;
 
        UNLEAK(lines);