Skip to content

Commit 7d8e72b

Browse files
dschogitster
authored andcommitted
fetch: avoid locking issues between fetch.jobs/fetch.writeCommitGraph
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>
1 parent c14e6e7 commit 7d8e72b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin/fetch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,8 @@ static int fetch_multiple(struct string_list *list, int max_children)
16021602
return errcode;
16031603
}
16041604

1605-
argv_array_pushl(&argv, "fetch", "--append", "--no-auto-gc", NULL);
1605+
argv_array_pushl(&argv, "fetch", "--append", "--no-auto-gc",
1606+
"--no-write-commit-graph", NULL);
16061607
add_options_to_argv(&argv);
16071608

16081609
if (max_children != 1 && list->nr != 1) {

0 commit comments

Comments
 (0)