Merge branch 'cw/fetch-remote-group-with-duplication'

"git fetch <group>", when "<group>" of remotes lists the same
remote twice, unnecessarily failed when parallel fetching was
enabled, which has been corrected.

* cw/fetch-remote-group-with-duplication:
  fetch: fix duplicate remote parallel fetch bug
This commit is contained in:
Junio C Hamano 2023-01-27 08:51:41 -08:00
commit d26e26a3f5
2 changed files with 10 additions and 0 deletions

View File

@ -2228,6 +2228,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
argv++;
}
}
string_list_remove_duplicates(&list, 0);
if (negotiate_only) {
struct oidset acked_commits = OIDSET_INIT;

View File

@ -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