3 # Copyright (c) 2007 Yann Dirson
6 test_description
='Test the "rebase" command.'
11 'Setup a multi-commit branch and fork an stgit stack' \
20 stg branch --create stack &&
22 git notes add -m note &&
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"
37 'Attempt rebase to non-existing commit' \
39 command_error stg rebase not-a-ref
43 'Check patches were re-applied' \
45 test $(stg series --applied -c) = 1