Better diagnostic for wrong branch configuration.
[stgit/ydirson.git] / t / t0001-subdir-branches.sh
blob0eed3a44088c1d7adede76ab90d090d04b86fba6
1 #!/bin/sh
3 # Copyright (c) 2006 Karl Hasselström
6 test_description='Branch names containing slashes
8 Test a number of operations on a repository that has branch names
9 containing slashes (that is, branches living in a subdirectory of
10 .git/refs/heads).'
12 . ./test-lib.sh
14 test_expect_success 'Create a patch' \
15 'stg init &&
16 echo "foo" > foo.txt &&
17 git add foo.txt &&
18 stg new foo -m "Add foo.txt" &&
19 stg refresh'
21 test_expect_success 'Old and new id with non-slashy branch' \
22 'stg id foo &&
23 stg id foo// &&
24 stg id foo/ &&
25 stg id foo//top &&
26 stg id foo/top &&
27 stg id foo@master &&
28 stg id foo@master//top &&
29 stg id foo@master/top'
31 test_expect_success 'Clone branch to slashier name' \
32 'stg branch --clone x/y/z'
34 test_expect_success 'Try new form of id with slashy branch' \
35 'stg id foo &&
36 stg id foo// &&
37 stg id foo//top &&
38 stg id foo@x/y/z &&
39 stg id foo@x/y/z//top'
41 test_expect_success 'Try old id with slashy branch' '
42 ! stg id foo/ &&
43 ! stg id foo/top &&
44 ! stg id foo@x/y/z/top
47 test_expect_success 'Create patch in slashy branch' \
48 'echo "bar" >> foo.txt &&
49 stg new bar -m "Add another line" &&
50 stg refresh'
52 test_expect_success 'Rename branches' \
53 'stg branch --rename master goo/gaa &&
54 ! git show-ref --verify --quiet refs/heads/master &&
55 stg branch --rename goo/gaa x1/x2/x3/x4 &&
56 ! git show-ref --verify --quiet refs/heads/goo/gaa &&
57 stg branch --rename x1/x2/x3/x4 servant &&
58 ! git show-ref --verify --quiet refs/heads/x1/x2/x3/x4
61 test_done