Restore `stg sink --nopush` capability
[stgit.git] / t / t2200-rebase.sh
blobb06fcdd112ab9a20c826ac36c039661b779c8bb4
1 #!/bin/sh
3 # Copyright (c) 2007 Yann Dirson
6 test_description='Test the "rebase" command.'
8 . ./test-lib.sh
10 test_expect_success \
11 'Setup a multi-commit branch and fork an stgit stack' \
13 echo foo > file1 &&
14 stg add file1 &&
15 git commit -m a &&
16 echo foo > file2 &&
17 stg add file2 &&
18 git commit -m b &&
20 stg branch --create stack &&
21 stg new p -m . &&
22 git notes add -m note &&
23 echo bar >> file1 &&
24 stg refresh
27 test_expect_success \
28 'Rebase to previous commit' \
30 stg rebase master~1 &&
31 test `stg id stack:{base}` = `git rev-parse master~1` &&
32 test `stg series --applied -c` = 1 &&
33 test "$(git notes show)" = "note"
36 test_expect_success \
37 'Attempt rebase to non-existing commit' \
39 command_error stg rebase not-a-ref
42 test_expect_success \
43 'Check patches were re-applied' \
45 test $(stg series --applied -c) = 1
48 test_done