Merge branch 'jk/dev-build-format-security'
[gitweb.git] / builtin / commit.c
index 213fca2d8ecdf726661e6b31b7ec6cb004acb2f7..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>..."),
@@ -251,7 +253,7 @@ static int list_paths(struct string_list *list, const char *with_tree,
 
                if (ce->ce_flags & CE_UPDATE)
                        continue;
-               if (!ce_path_match(ce, pattern, m))
+               if (!ce_path_match(&the_index, ce, pattern, m))
                        continue;
                item = string_list_insert(list, ce->name);
                if (ce_skip_worktree(ce))
@@ -1651,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);