Test that we can add a new file to a non-topmost patch with refresh -p
[stgit] / t / t2900-rename.sh
CommitLineData
65de4cc0
OK
1#!/bin/sh
2#
3# Copyright (c) 2008 Onno Kortmann
4# Parts taken from the other test scripts
5# in this directory.
6#
7
8test_description='stg rename test
9
10Tests some parts of the stg rename command.'
11
12. ./test-lib.sh
13stg init
14
15test_expect_success 'Rename in empty' '
16 ! stg rename foo
17'
18
19test_expect_success 'Rename single top-most' '
20 stg new -m foo &&
21 stg rename bar
22'
23# bar
24
25test_expect_success 'Rename non-existing' '
26 ! stg rename neithersuchpatch norsuchpatch
27'
28
29test_expect_success 'Rename with two arguments' '
30 stg new -m baz &&
31 stg rename bar foo
32'
33# foo,baz
34
35test_expect_success 'Rename to existing name' '
36 ! stg rename foo baz
37'
38
39test_expect_success 'Rename to same name' '
40 ! stg rename foo foo
41'
42
43test_expect_success 'Rename top-most when others exist' '
44 stg rename bar
45'
46
47test_done