3 test_description
='git remote group handling'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7 TEST_PASSES_SANITIZE_LEAK
=true
16 echo content
>>file &&
18 git commit
-F ..
/mark
)
27 if test "$(git log -1 --pretty=format:%s $1 --)" = "$(cat mark)"; then
28 echo >&2 "repo was fetched: $1"
31 echo >&2 "repo was not fetched: $1"
35 test_expect_success
'setup' '
36 mkdir one && (cd one && git init) &&
37 mkdir two && (cd two && git init) &&
38 git remote add -m main one one &&
39 git remote add -m main two two
42 test_expect_success
'no group updates all' '
50 test_expect_success
'nonexistent group produces error' '
53 test_must_fail git remote update nonexistent &&
58 test_expect_success
'updating group updates all members (remote update)' '
61 git config --add remotes.all one &&
62 git config --add remotes.all two &&
63 git remote update all &&
68 test_expect_success
'updating group updates all members (fetch)' '
69 mark fetch-group-all &&
76 test_expect_success
'updating group does not update non-members (remote update)' '
79 git config --add remotes.some one &&
80 git remote update some &&
85 test_expect_success
'updating group does not update non-members (fetch)' '
86 mark fetch-group-some &&
88 git config --add remotes.some one &&
89 git remote update some &&
94 test_expect_success
'updating remote name updates that remote' '
97 git remote update one &&
102 test_expect_success
'updating group in parallel with a duplicate remote does not fail (fetch)' '
103 mark fetch-group-duplicate &&
105 git config --add remotes.duplicate one &&
106 git config --add remotes.duplicate one &&
107 git -c fetch.parallel=2 remote update duplicate &&