]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fetch: avoid locking issues between fetch.jobs/fetch.writeCommitGraph
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 3 Nov 2019 00:21:57 +0000 (00:21 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Nov 2019 01:59:37 +0000 (10:59 +0900)
When both `fetch.jobs` and `fetch.writeCommitGraph` is set, we currently
try to write the commit graph in each of the concurrent fetch jobs,
which frequently leads to error messages like this one:

fatal: Unable to create '.../.git/objects/info/commit-graphs/commit-graph-chain.lock': File exists.

Let's avoid this by holding off from writing the commit graph until all
fetch jobs are done.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c

index 8d27f8abb7b67c27caceb979b59cbc0da983d54b..20bcda09c4ba698659b23a2035f8f65639fac9a0 100644 (file)
@@ -1602,7 +1602,8 @@ static int fetch_multiple(struct string_list *list, int max_children)
                        return errcode;
        }
 
-       argv_array_pushl(&argv, "fetch", "--append", "--no-auto-gc", NULL);
+       argv_array_pushl(&argv, "fetch", "--append", "--no-auto-gc",
+                       "--no-write-commit-graph", NULL);
        add_options_to_argv(&argv);
 
        if (max_children != 1 && list->nr != 1) {