Skip to content

Commit d26e26a

Browse files
committed
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
2 parents 8f82904 + 06a668c commit d26e26a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

builtin/fetch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
22282228
argv++;
22292229
}
22302230
}
2231+
string_list_remove_duplicates(&list, 0);
22312232

22322233
if (negotiate_only) {
22332234
struct oidset acked_commits = OIDSET_INIT;

t/t5506-remote-groups.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,13 @@ test_expect_success 'updating remote name updates that remote' '
9999
! repo_fetched two
100100
'
101101

102+
test_expect_success 'updating group in parallel with a duplicate remote does not fail (fetch)' '
103+
mark fetch-group-duplicate &&
104+
update_repo one &&
105+
git config --add remotes.duplicate one &&
106+
git config --add remotes.duplicate one &&
107+
git -c fetch.parallel=2 remote update duplicate &&
108+
repo_fetched one
109+
'
110+
102111
test_done

0 commit comments

Comments
 (0)