]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ds/commit-graph-merging-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 2 Nov 2020 21:17:39 +0000 (13:17 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Nov 2020 21:17:39 +0000 (13:17 -0800)
When "git commit-graph" detects the same commit recorded more than
once while it is merging the layers, it used to die.  The code now
ignores all but one of them and continues.

* ds/commit-graph-merging-fix:
  commit-graph: don't write commit-graph when disabled
  commit-graph: ignore duplicates when merging layers

1  2 
Documentation/git-commit-graph.txt
commit-graph.c
t/t5324-split-commit-graph.sh

Simple merge
diff --cc commit-graph.c
index cb042bdba8c83288cfc1e42853447d5bc06f47fe,33b3a2086c9b1659782a096e4efccd8584b2c02a..6f62a0731383293eb7e617f0ecda932d421757fd
@@@ -2148,8 -2061,12 +2158,13 @@@ int write_commit_graph(struct object_di
        uint32_t i, count_distinct = 0;
        int res = 0;
        int replace = 0;
 +      struct bloom_filter_settings bloom_settings = DEFAULT_BLOOM_FILTER_SETTINGS;
  
+       prepare_repo_settings(the_repository);
+       if (!the_repository->settings.core_commit_graph) {
+               warning(_("attempting to write a commit-graph, but 'core.commitGraph' is disabled"));
+               return 0;
+       }
        if (!commit_graph_compatible(the_repository))
                return 0;
  
Simple merge