diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-01-27 16:51:41 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-27 16:51:41 (GMT) |
commit | d26e26a3f50670c52b95149f4b52ec1396512053 (patch) | |
tree | b67561957b4e402fb0b51dddb03c582d61fc4857 | |
parent | 8f82904caf130112a3373a63116e94e6ae31e56d (diff) | |
parent | 06a668cb90a6e8628f295adb6177855bb0a85a4a (diff) | |
download | git-d26e26a3f50670c52b95149f4b52ec1396512053.zip git-d26e26a3f50670c52b95149f4b52ec1396512053.tar.gz git-d26e26a3f50670c52b95149f4b52ec1396512053.tar.bz2 |
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
-rw-r--r-- | builtin/fetch.c | 1 | ||||
-rwxr-xr-x | t/t5506-remote-groups.sh | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 7378caf..1297862 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -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; diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh index 5bac03e..0e17617 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 |