t6012: make rev-list tests more interesting
[gitweb.git] / builtin / commit.c
index 21277dd42e8e2ea60e42eb770f57502997fd63de..b57d8e4b82052bdb85287b5fcb675261a68c639b 100644 (file)
@@ -33,6 +33,8 @@
 #include "sequencer.h"
 #include "mailmap.h"
 #include "help.h"
+#include "commit-reach.h"
+#include "commit-graph.h"
 
 static const char * const builtin_commit_usage[] = {
        N_("git commit [<options>] [--] <pathspec>..."),
@@ -1647,9 +1649,12 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
        unlink(git_path_squash_msg(the_repository));
 
        if (commit_index_files())
-               die (_("Repository has been updated, but unable to write\n"
-                    "new_index file. Check that disk is not full and quota is\n"
-                    "not exceeded, and then \"git reset HEAD\" to recover."));
+               die(_("repository has been updated, but unable to write\n"
+                     "new_index file. Check that disk is not full and quota is\n"
+                     "not exceeded, and then \"git reset HEAD\" to recover."));
+
+       if (git_env_bool(GIT_TEST_COMMIT_GRAPH, 0))
+               write_commit_graph_reachable(get_object_directory(), 0);
 
        rerere(0);
        run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);