added index caching
[git/mingw/4msysgit/wingit-dll.git] / t / t5506-remote-groups.sh
blob2a1806b0b4427abb410d0310ba8c1ec52f8bde58
1 #!/bin/sh
3 test_description='git remote group handling'
4 . ./test-lib.sh
6 mark() {
7 echo "$1" >mark
10 update_repo() {
11 (cd $1 &&
12 echo content >>file &&
13 git add file &&
14 git commit -F ../mark)
17 update_repos() {
18 update_repo one $1 &&
19 update_repo two $1
22 repo_fetched() {
23 if test "`git log -1 --pretty=format:%s $1 --`" = "`cat mark`"; then
24 echo >&2 "repo was fetched: $1"
25 return 0
27 echo >&2 "repo was not fetched: $1"
28 return 1
31 test_expect_success 'setup' '
32 mkdir one && (cd one && git init) &&
33 mkdir two && (cd two && git init) &&
34 git remote add -m master one one &&
35 git remote add -m master two two
38 test_expect_success 'no group updates all' '
39 mark update-all &&
40 update_repos &&
41 git remote update &&
42 repo_fetched one &&
43 repo_fetched two
46 test_expect_success 'nonexistant group produces error' '
47 mark nonexistant &&
48 update_repos &&
49 test_must_fail git remote update nonexistant &&
50 ! repo_fetched one &&
51 ! repo_fetched two
54 test_expect_success 'updating group updates all members' '
55 mark group-all &&
56 update_repos &&
57 git config --add remotes.all one &&
58 git config --add remotes.all two &&
59 git remote update all &&
60 repo_fetched one &&
61 repo_fetched two
64 test_expect_success 'updating group does not update non-members' '
65 mark group-some &&
66 update_repos &&
67 git config --add remotes.some one &&
68 git remote update some &&
69 repo_fetched one &&
70 ! repo_fetched two
73 test_expect_success 'updating remote name updates that remote' '
74 mark remote-name &&
75 update_repos &&
76 git remote update one &&
77 repo_fetched one &&
78 ! repo_fetched two
81 test_done