| 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2006 Catalin Marinas |
| 4 | # |
| 5 | |
| 6 | test_description='Branch cloning. |
| 7 | |
| 8 | Exercises branch cloning options. |
| 9 | ' |
| 10 | |
| 11 | . ./test-lib.sh |
| 12 | |
| 13 | test_expect_success \ |
| 14 | 'Create a GIT commit' \ |
| 15 | ' |
| 16 | echo bar > bar.txt && |
| 17 | git add bar.txt && |
| 18 | git commit -a -m bar |
| 19 | ' |
| 20 | |
| 21 | test_expect_failure \ |
| 22 | 'Try to create a patch in a GIT branch' \ |
| 23 | ' |
| 24 | stg new p0 -m "p0" |
| 25 | ' |
| 26 | |
| 27 | test_expect_success \ |
| 28 | 'Clone the current GIT branch' \ |
| 29 | ' |
| 30 | stg branch --clone foo && |
| 31 | stg new p1 -m "p1" && |
| 32 | test $(stg applied -c) -eq 1 |
| 33 | ' |
| 34 | |
| 35 | test_expect_success \ |
| 36 | 'Clone the current StGIT branch' \ |
| 37 | ' |
| 38 | stg branch --clone bar && |
| 39 | test $(stg applied -c) -eq 1 && |
| 40 | stg new p2 -m "p2" && |
| 41 | test $(stg applied -c) -eq 2 |
| 42 | ' |
| 43 | |
| 44 | test_done |