Stack metadata version 4
[stgit.git] / t / t2110-pull-stack.sh
blob7eeef7e19880a91b2aeac549d1e046d15f839db5
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 'Pull master and stack with all applied' '
18 test_create_repo cloned &&
19 (cd cloned &&
20 git config pull.ff only &&
21 git pull -f ../upstream master:master master.stgit:master.stgit &&
22 [ "$(echo $(stg series --applied --noprefix))" = "patch-1 patch-2 patch-3" ]
26 test_expect_success 'Pull master and stack with unapplied patches' '
27 (cd upstream &&
28 stg pop
29 ) &&
30 (cd cloned &&
31 git pull -f ../upstream master:master master.stgit:master.stgit &&
32 [ "$(echo $(stg series --applied --noprefix))" = "patch-1 patch-2" ] &&
33 [ "$(echo $(stg series --unapplied --noprefix))" = "patch-3" ]
37 test_done