Tests redirect to err file when grepping stderr
[stgit.git] / t / t0001-subdir-branches.sh
blob8169f075544126123dd256732a61bb6b5afc8a39
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 stg add foo.txt &&
18 stg new foo -m "Add foo.txt" &&
19 stg refresh'
21 test_expect_success 'Try id with non-slashy branch' \
22 'stg id &&
23 stg id foo &&
24 stg id foo^ &&
25 stg id master:foo &&
26 stg id master:foo^'
28 test_expect_success 'Clone branch to slashier name' \
29 'stg branch --clone x/y/z'
31 test_expect_success 'Try new id with slashy branch' \
32 'stg id foo &&
33 stg id foo^ &&
34 stg id x/y/z:foo &&
35 stg id x/y/z:foo^'
37 test_expect_success 'Try old id with slashy branch' '
38 command_error stg id foo/ &&
39 command_error stg id foo/top &&
40 command_error stg id foo@x/y/z/top
43 test_expect_success 'Create patch in slashy branch' \
44 'echo "bar" >> foo.txt &&
45 stg new bar -m "Add another line" &&
46 stg refresh'
48 test_expect_success 'Rename branches' \
49 'stg branch --rename master goo/gaa &&
50 test_must_fail git show-ref --verify --quiet refs/heads/master &&
51 stg branch --rename goo/gaa x1/x2/x3/x4 &&
52 test_must_fail git show-ref --verify --quiet refs/heads/goo/gaa &&
53 stg branch --rename x1/x2/x3/x4 servant &&
54 test_must_fail git show-ref --verify --quiet refs/heads/x1/x2/x3/x4
57 test_done