]>
Commit | Line | Data |
---|---|---|
7f87aff2 TA |
1 | #!/bin/sh |
2 | ||
3 | test_description='pull options' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7f87aff2 TA |
7 | test_expect_success 'setup' ' |
8 | mkdir parent && | |
9 | (cd parent && git init && | |
10 | echo one >file && git add file && | |
11 | git commit -m one) | |
12 | ' | |
13 | ||
7f87aff2 TA |
14 | test_expect_success 'git pull -q' ' |
15 | mkdir clonedq && | |
13e65fe6 JH |
16 | (cd clonedq && git init && |
17 | git pull -q "../parent" >out 2>err && | |
18 | test ! -s err && | |
19 | test ! -s out) | |
7f87aff2 TA |
20 | ' |
21 | ||
7f87aff2 TA |
22 | test_expect_success 'git pull' ' |
23 | mkdir cloned && | |
13e65fe6 JH |
24 | (cd cloned && git init && |
25 | git pull "../parent" >out 2>err && | |
26 | test -s err && | |
27 | test ! -s out) | |
7f87aff2 | 28 | ' |
7f87aff2 TA |
29 | |
30 | test_expect_success 'git pull -v' ' | |
31 | mkdir clonedv && | |
13e65fe6 JH |
32 | (cd clonedv && git init && |
33 | git pull -v "../parent" >out 2>err && | |
34 | test -s err && | |
35 | test ! -s out) | |
7f87aff2 TA |
36 | ' |
37 | ||
7f87aff2 TA |
38 | test_expect_success 'git pull -v -q' ' |
39 | mkdir clonedvq && | |
13e65fe6 JH |
40 | (cd clonedvq && git init && |
41 | git pull -v -q "../parent" >out 2>err && | |
42 | test ! -s out && | |
43 | test ! -s err) | |
7f87aff2 TA |
44 | ' |
45 | ||
7f87aff2 TA |
46 | test_expect_success 'git pull -q -v' ' |
47 | mkdir clonedqv && | |
13e65fe6 JH |
48 | (cd clonedqv && git init && |
49 | git pull -q -v "../parent" >out 2>err && | |
50 | test ! -s out && | |
51 | test -s err) | |
7f87aff2 TA |
52 | ' |
53 | ||
bba5322a JH |
54 | test_expect_success 'git pull --force' ' |
55 | mkdir clonedoldstyle && | |
56 | (cd clonedoldstyle && git init && | |
57 | cat >>.git/config <<-\EOF && | |
58 | [remote "one"] | |
59 | url = ../parent | |
60 | fetch = refs/heads/master:refs/heads/mirror | |
61 | [remote "two"] | |
62 | url = ../parent | |
63 | fetch = refs/heads/master:refs/heads/origin | |
64 | [branch "master"] | |
65 | remote = two | |
66 | merge = refs/heads/master | |
67 | EOF | |
68 | git pull two && | |
69 | test_commit A && | |
70 | git branch -f origin && | |
71 | git pull --all --force | |
72 | ) | |
73 | ' | |
74 | ||
e6cc5104 JH |
75 | test_expect_success 'git pull --all' ' |
76 | mkdir clonedmulti && | |
77 | (cd clonedmulti && git init && | |
78 | cat >>.git/config <<-\EOF && | |
79 | [remote "one"] | |
80 | url = ../parent | |
81 | fetch = refs/heads/*:refs/remotes/one/* | |
82 | [remote "two"] | |
83 | url = ../parent | |
84 | fetch = refs/heads/*:refs/remotes/two/* | |
85 | [branch "master"] | |
86 | remote = one | |
87 | merge = refs/heads/master | |
88 | EOF | |
89 | git pull --all | |
90 | ) | |
91 | ' | |
92 | ||
7f87aff2 | 93 | test_done |