Test the 'stg rename' command
[stgit.git] / t / t2900-rename.sh
blob5f47f864473422d580e5fbc4b34bdc5cf0160454
1 #!/bin/sh
3 # Copyright (c) 2008 Onno Kortmann
4 # Parts taken from the other test scripts
5 # in this directory.
8 test_description='stg rename test
10 Tests some parts of the stg rename command.'
12 . ./test-lib.sh
13 stg init
15 test_expect_success 'Rename in empty' '
16 ! stg rename foo
19 test_expect_success 'Rename single top-most' '
20 stg new -m foo &&
21 stg rename bar
23 # bar
25 test_expect_success 'Rename non-existing' '
26 ! stg rename neithersuchpatch norsuchpatch
29 test_expect_success 'Rename with two arguments' '
30 stg new -m baz &&
31 stg rename bar foo
33 # foo,baz
35 test_expect_success 'Rename to existing name' '
36 ! stg rename foo baz
39 test_expect_success 'Rename to same name' '
40 ! stg rename foo foo
43 test_expect_success 'Rename top-most when others exist' '
44 stg rename bar
47 test_done