commit-graph: return with errors during write
[gitweb.git] / builtin / gc.c
index 020f725acc40f413c49f812ea0e6aac0153d097c..3984addf73c48a53afb3f8546836733acb77f53e 100644 (file)
@@ -664,9 +664,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
                clean_pack_garbage();
        }
 
-       if (gc_write_commit_graph)
-               write_commit_graph_reachable(get_object_directory(), 0,
-                                            !quiet && !daemonized);
+       if (gc_write_commit_graph &&
+           write_commit_graph_reachable(get_object_directory(), 0,
+                                        !quiet && !daemonized))
+               return 1;
 
        if (auto_gc && too_many_loose_objects())
                warning(_("There are too many unreachable loose objects; "