Commit | Line | Data |
---|---|---|
bcfe759b YD |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2006 Yann Dirson | |
4 | # | |
5 | ||
6 | test_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 | |
16 | test_create_repo foo | |
17 | ||
18 | test_expect_success \ | |
19 | 'Setup and clone tree, and setup changes' \ | |
20 | "(cd foo && | |
c7506039 | 21 | printf 'a\nb\n' > file && stg add file && git commit -m . |
bcfe759b YD |
22 | ) && |
23 | stg clone foo bar && | |
24 | (cd bar && stg new p1 -m p1 | |
25 | printf 'c\n' >> file && stg refresh | |
26 | ) | |
27 | " | |
28 | ||
29 | test_expect_success \ | |
30 | 'Port those patches to orig tree' \ | |
16d69115 | 31 | '(cd foo && |
04b44217 | 32 | GIT_DIR=../bar/.git git format-patch --stdout \ |
48c930db | 33 | $(cd ../bar && stg id master:{base})..HEAD | |
04b44217 | 34 | git am -3 -k |
bcfe759b | 35 | ) |
16d69115 | 36 | ' |
bcfe759b YD |
37 | |
38 | test_expect_success \ | |
2ac49695 YD |
39 | 'Pull those patches applied upstream, without pushing' \ |
40 | "(cd bar && stg pull --nopush | |
41 | ) | |
42 | " | |
43 | ||
92d99c04 | 44 | test_expect_success \ |
2ac49695 YD |
45 | 'Try to push those patches without merge detection' \ |
46 | "(cd bar && stg push --all | |
47 | ) | |
48 | " | |
49 | ||
50 | test_expect_success \ | |
bcfe759b | 51 | 'Pull those patches applied upstream' \ |
625e8de7 | 52 | "(cd bar && stg undo && stg push --all --merged |
bcfe759b YD |
53 | ) |
54 | " | |
55 | ||
56 | test_expect_success \ | |
57 | 'Check that all went well' \ | |
d9b2f20a | 58 | "test_cmp foo/file bar/file |
bcfe759b YD |
59 | " |
60 | ||
61 | test_done |