Add --keep option to goto
[stgit/ydirson.git] / t / t1201-pull-trailing.sh
blob46d9f825479c75608c99ad987e39c208e8459aa9
1 #!/bin/sh
3 # Copyright (c) 2006 Yann Dirson
6 test_description='test
10 . ./test-lib.sh
12 # don't need this repo, but better not drop it, see t1100
13 #rm -rf .git
15 # Need a repo to clone
16 test_create_repo foo
18 test_expect_success \
19 'Setup and clone tree, and setup changes' \
20 "(cd foo &&
21 printf 'a\nb\n' > file && git add file && git commit -m .
22 ) &&
23 stg clone foo bar &&
24 (cd bar && stg new p1 -m p1
25 printf 'c\n' >> file && stg refresh
29 test_expect_success \
30 'Port those patches to orig tree' \
31 '(cd foo &&
32 GIT_DIR=../bar/.git git-format-patch --stdout \
33 $(cd ../bar && stg id base@master)..HEAD |
34 git-am -3 -k
38 test_expect_success \
39 'Pull those patches applied upstream, without pushing' \
40 "(cd bar && stg pull --nopush
44 test_expect_success \
45 'Try to push those patches without merge detection' \
46 "(cd bar && stg push --all
50 test_expect_success \
51 'Pull those patches applied upstream' \
52 "(cd bar && stg push --undo && stg push --all --merged
56 test_expect_success \
57 'Check that all went well' \
58 "diff -u foo/file bar/file
61 test_done