3 test_description
='Check that pulling a stack ref works'
7 test_create_repo upstream
9 test_expect_success
'Setup upstream with patches' '
11 test_commit_bulk --message="patch %s" --filename=foo.txt --contents="line %s" 3 &&
17 test_expect_success
'Fetch and reset master and stack with all applied' '
18 test_create_repo 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' '
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" ]