Tests redirect to err file when grepping stderr
[stgit.git] / t / t2110-pull-stack.sh
blobca3fa41d443f153c092a4d440ff6bd4549ac64d7
1 #!/bin/sh
3 test_description='Check that pulling a stack ref works'
5 . ./test-lib.sh
7 test_create_repo upstream
9 test_expect_success 'Setup upstream with patches' '
10 (cd upstream &&
11 test_commit_bulk --message="patch %s" --filename=foo.txt --contents="line %s" 3 &&
12 stg init &&
13 stg uncommit -n 3
17 test_expect_success 'Fetch and reset master and stack with all applied' '
18 test_create_repo cloned &&
19 (cd cloned &&
20 git config pull.ff only &&
21 git remote add upstream ../upstream &&
22 git fetch upstream master &&
23 git reset --hard upstream/master &&
24 git fetch -f upstream refs/stacks/master:refs/stacks/master &&
25 [ "$(echo $(stg series --applied --noprefix))" = "patch-1 patch-2 patch-3" ]
29 test_expect_success 'Fetch and reset master and stack with unapplied patches' '
30 (cd upstream &&
31 stg pop
32 ) &&
33 (cd cloned &&
34 git fetch upstream master &&
35 git reset --hard upstream/master &&
36 git fetch -f upstream refs/stacks/master:refs/stacks/master &&
37 [ "$(echo $(stg series --applied --noprefix))" = "patch-1 patch-2" ] &&
38 [ "$(echo $(stg series --unapplied --noprefix))" = "patch-3" ]
42 test_done