summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-09-17 13:53:58 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-09-17 13:53:58 -0700
commit06880cff3892185ae71839636e2d2c688413eccb (patch)
tree384648785a690c489a009f16d4c7d1e39901344d /builtin/commit.c
parentMerge branch 'jk/pack-objects-with-bitmap-fix' (diff)
parentcommit-graph: define GIT_TEST_COMMIT_GRAPH (diff)
downloadtgif-06880cff3892185ae71839636e2d2c688413eccb.tar.xz
Merge branch 'ds/commit-graph-tests'
We can now optionally run tests with commit-graph enabled. * ds/commit-graph-tests: commit-graph: define GIT_TEST_COMMIT_GRAPH
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index fa3e53232d..b57d8e4b82 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -34,6 +34,7 @@
#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>..."),
@@ -1652,6 +1653,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
"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);
run_commit_hook(use_editor, get_index_file(), "post-commit", NULL);