Do not use data_files in setup.py
[stgit.git] / t / t1008-branch-description.sh
blob3d76514beb0b0b8e4b1e86bc9ccf03606ae14d28
1 #!/bin/sh
3 test_description='Test branch descriptions'
5 . ./test-lib.sh
7 test_expect_success \
8 'Description of non-stgit branch' '
9 test "$(stg branch)" = "master" &&
10 test_must_fail git config --get branch.master.description &&
11 stg branch --description="master branch description" &&
12 test "$(git config --get branch.master.description)" = "master branch description"
15 test_expect_success \
16 'Remove description of non-stgit branch' '
17 stg branch --description="" &&
18 test_must_fail git config --get branch.master.description
21 test_expect_success \
22 'Describe stgit branch' '
23 stg branch --create foo &&
24 test_must_fail git config --get branch.foo.description
25 stg branch --description="foo branch description" &&
26 test "$(git config --get branch.foo.description)" = "foo branch description"
29 test_expect_success \
30 'Remove stgit branch description' '
31 stg branch -d "" &&
32 test_must_fail git config --get branch.foo.description
35 test_expect_success \
36 'Describe non-current branch' '
37 stg branch --clone bar &&
38 stg branch foo &&
39 test "$(git config --get branch.bar.description)" = "clone of \"foo\"" &&
40 stg branch --description="Bar Branch Description" bar &&
41 test "$(git config --get branch.bar.description)" = "Bar Branch Description"
44 test_expect_success \
45 'Invalid arguments' '
46 command_error stg branch -d "a description" bar foo 2>&1 |
47 grep -e "incorrect number of arguments"
50 test_expect_success \
51 'Check descriptions in list' '
52 stg branch --list > list.txt &&
53 cat list.txt &&
54 cat list.txt | grep -E "bar +| Bar Branch Description" &&
55 cat list.txt | grep -E "foo +| " &&
56 cat list.txt | grep -E "master +| "
59 test_done