Move identification of parent branch's remote def up into stack class.
[stgit] / t / t1201-pull-trailing.sh
CommitLineData
bcfe759b
YD
1#!/bin/sh
2#
3# Copyright (c) 2006 Yann Dirson
4#
5
6test_description='test
7
8'
9
10. ./test-lib.sh
11
12# don't need this repo, but better not drop it, see t1100
13#rm -rf .git
14
15# Need a repo to clone
16test_create_repo foo
17
18test_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
26 )
27"
28
29test_expect_success \
30 'Port those patches to orig tree' \
31 "(cd foo &&
32 GIT_DIR=../bar/.git git-format-patch --stdout bases/master..HEAD |
33 git-am -3 -k
34 )
35"
36
37test_expect_success \
2ac49695
YD
38 'Pull those patches applied upstream, without pushing' \
39 "(cd bar && stg pull --nopush
40 )
41"
42
92d99c04 43test_expect_success \
2ac49695
YD
44 'Try to push those patches without merge detection' \
45 "(cd bar && stg push --all
46 )
47"
48
49test_expect_success \
bcfe759b 50 'Pull those patches applied upstream' \
92d99c04 51 "(cd bar && stg push --undo && stg push --all --merged
bcfe759b
YD
52 )
53"
54
55test_expect_success \
56 'Check that all went well' \
57 "diff -u foo/file bar/file
58"
59
60test_done