File: t1201-pull-trailing.sh

package info (click to toggle)
stgit 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,752 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (61 lines) | stat: -rwxr-xr-x 1,176 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
#
# Copyright (c) 2006 Yann Dirson
#

test_description='test

'

. ./test-lib.sh

# don't need this repo, but better not drop it, see t1100
#rm -rf .git

# Need a repo to clone
test_create_repo foo

test_expect_success \
    'Setup and clone tree, and setup changes' \
    "(cd foo &&
      printf 'a\nb\n' > file && stg add file && git commit -m .
     ) &&
     stg clone foo bar &&
     (cd bar && stg new p1 -m p1
      printf 'c\n' >> file && stg refresh
     )
"

test_expect_success \
    'Port those patches to orig tree' \
    '(cd foo &&
      GIT_DIR=../bar/.git git format-patch --stdout \
          $(cd ../bar && stg id master:{base})..HEAD |
      git am -3 -k
     )
    '

test_expect_success \
    'Pull those patches applied upstream, without pushing' \
    "(cd bar && stg pull --nopush
     )
"

test_expect_success \
    'Try to push those patches without merge detection' \
    "(cd bar && stg push --all
     )
"

test_expect_success \
    'Pull those patches applied upstream' \
    "(cd bar && stg undo && stg push --all --merged
     )
"

test_expect_success \
    'Check that all went well' \
    "test_cmp foo/file bar/file
"

test_done