3
3
# Copyright (c) 2006 Yann Dirson
4
4
#
5
5
6
- test_description=' test
7
-
8
- '
6
+ test_description=' Test pull behaviors'
9
7
10
8
. ./test-lib.sh
11
9
@@ -15,54 +13,56 @@ test_description='test
15
13
# Need a repo to clone
16
14
test_create_repo foo
17
15
18
- test_expect_success \
19
- ' Setup and clone tree, and setup changes ' \
20
- " (
21
- cd foo &&
22
- printf 'a\nb\n' > file &&
23
- stg add file &&
24
- git commit -m .
25
- ) &&
26
- git clone foo bar &&
27
- (
28
- cd bar &&
29
- stg init &&
30
- stg new p1 -m p1 &&
31
- printf 'c\n' >> file &&
32
- stg refresh
33
- )
34
- "
16
+ test_expect_success ' Setup and clone tree, and setup changes ' '
17
+ (
18
+ cd foo &&
19
+ echo a >file &&
20
+ echo b >> file &&
21
+ stg add file &&
22
+ git commit -m .
23
+ ) &&
24
+ git clone foo bar &&
25
+ (
26
+ cd bar &&
27
+ stg init &&
28
+ stg new p1 -m p1 &&
29
+ echo c >> file &&
30
+ stg refresh
31
+ )
32
+ '
35
33
36
- test_expect_success \
37
- ' Port those patches to orig tree' \
38
- ' (cd foo &&
39
- GIT_DIR=../bar/.git git format-patch --stdout \
40
- $(cd ../bar && stg id master:{base})..HEAD |
41
- git am -3 -k
42
- )
43
- '
34
+ test_expect_success ' Port those patches to orig tree' '
35
+ (
36
+ cd foo &&
37
+ git -C ../bar format-patch --stdout $(stg -C ../bar id master:{base})..HEAD |
38
+ git am -3 -k
39
+ )
40
+ '
44
41
45
- test_expect_success \
46
- ' Pull those patches applied upstream, without pushing' \
47
- " (cd bar && stg pull --nopush
48
- )
49
- "
42
+ test_expect_success ' Pull those patches applied upstream, without pushing' '
43
+ (
44
+ cd bar &&
45
+ stg pull --nopush
46
+ )
47
+ '
50
48
51
- test_expect_success \
52
- ' Try to push those patches without merge detection' \
53
- " (cd bar && stg push --all
54
- )
55
- "
49
+ test_expect_success ' Try to push those patches without merge detection' '
50
+ (
51
+ cd bar &&
52
+ stg push --all
53
+ )
54
+ '
56
55
57
- test_expect_success \
58
- ' Pull those patches applied upstream' \
59
- " (cd bar && stg undo && stg push --all --merged
60
- )
61
- "
56
+ test_expect_success ' Pull those patches applied upstream' '
57
+ (
58
+ cd bar &&
59
+ stg undo &&
60
+ stg push --all --merged
61
+ )
62
+ '
62
63
63
- test_expect_success \
64
- ' Check that all went well' \
65
- " test_cmp foo/file bar/file
66
- "
64
+ test_expect_success ' Check that all went well' '
65
+ test_cmp foo/file bar/file
66
+ '
67
67
68
68
test_done
0 commit comments