From 06a668cb90a6e8628f295adb6177855bb0a85a4a Mon Sep 17 00:00:00 2001 From: Calvin Wan Date: Thu, 19 Jan 2023 22:05:38 +0000 Subject: fetch: fix duplicate remote parallel fetch bug Fetching in parallel from a remote group with a duplicated remote results in the following: error: cannot lock ref '': is at but expected This doesn't happen in serial since fetching from the same remote that has already been fetched from is a noop. Therefore, remove any duplicated remotes after remote groups are parsed. Signed-off-by: Calvin Wan Signed-off-by: Junio C Hamano --- t/t5506-remote-groups.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 't/t5506-remote-groups.sh') diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh index 5bac03ede8..0e176175a3 100755 --- a/t/t5506-remote-groups.sh +++ b/t/t5506-remote-groups.sh @@ -99,4 +99,13 @@ test_expect_success 'updating remote name updates that remote' ' ! repo_fetched two ' +test_expect_success 'updating group in parallel with a duplicate remote does not fail (fetch)' ' + mark fetch-group-duplicate && + update_repo one && + git config --add remotes.duplicate one && + git config --add remotes.duplicate one && + git -c fetch.parallel=2 remote update duplicate && + repo_fetched one +' + test_done -- cgit v1.2.3