Merge branch 'lf/read-blob-data-from-index'
[alt-git.git] / t / t5521-pull-options.sh
blobaa31abe32b3abc1b43d8111f6503313aa8237455
1 #!/bin/sh
3 test_description='pull options'
5 . ./test-lib.sh
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)
14 test_expect_success 'git pull -q' '
15 mkdir clonedq &&
16 (cd clonedq && git init &&
17 git pull -q "../parent" >out 2>err &&
18 test ! -s err &&
19 test ! -s out)
22 test_expect_success 'git pull -q --rebase' '
23 mkdir clonedqrb &&
24 (cd clonedqrb && git init &&
25 git pull -q --rebase "../parent" >out 2>err &&
26 test ! -s err &&
27 test ! -s out &&
28 git pull -q --rebase "../parent" >out 2>err &&
29 test ! -s err &&
30 test ! -s out)
33 test_expect_success 'git pull' '
34 mkdir cloned &&
35 (cd cloned && git init &&
36 git pull "../parent" >out 2>err &&
37 test -s err &&
38 test ! -s out)
41 test_expect_success 'git pull --rebase' '
42 mkdir clonedrb &&
43 (cd clonedrb && git init &&
44 git pull --rebase "../parent" >out 2>err &&
45 test -s err &&
46 test ! -s out)
49 test_expect_success 'git pull -v' '
50 mkdir clonedv &&
51 (cd clonedv && git init &&
52 git pull -v "../parent" >out 2>err &&
53 test -s err &&
54 test ! -s out)
57 test_expect_success 'git pull -v --rebase' '
58 mkdir clonedvrb &&
59 (cd clonedvrb && git init &&
60 git pull -v --rebase "../parent" >out 2>err &&
61 test -s err &&
62 test ! -s out)
65 test_expect_success 'git pull -v -q' '
66 mkdir clonedvq &&
67 (cd clonedvq && git init &&
68 git pull -v -q "../parent" >out 2>err &&
69 test ! -s out &&
70 test ! -s err)
73 test_expect_success 'git pull -q -v' '
74 mkdir clonedqv &&
75 (cd clonedqv && git init &&
76 git pull -q -v "../parent" >out 2>err &&
77 test ! -s out &&
78 test -s err)
81 test_expect_success 'git pull --force' '
82 mkdir clonedoldstyle &&
83 (cd clonedoldstyle && git init &&
84 cat >>.git/config <<-\EOF &&
85 [remote "one"]
86 url = ../parent
87 fetch = refs/heads/master:refs/heads/mirror
88 [remote "two"]
89 url = ../parent
90 fetch = refs/heads/master:refs/heads/origin
91 [branch "master"]
92 remote = two
93 merge = refs/heads/master
94 EOF
95 git pull two &&
96 test_commit A &&
97 git branch -f origin &&
98 git pull --all --force
102 test_expect_success 'git pull --all' '
103 mkdir clonedmulti &&
104 (cd clonedmulti && git init &&
105 cat >>.git/config <<-\EOF &&
106 [remote "one"]
107 url = ../parent
108 fetch = refs/heads/*:refs/remotes/one/*
109 [remote "two"]
110 url = ../parent
111 fetch = refs/heads/*:refs/remotes/two/*
112 [branch "master"]
113 remote = one
114 merge = refs/heads/master
116 git pull --all
120 test_done