3 test_description
='Test branch descriptions'
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"
16 'Remove description of non-stgit branch' '
17 stg branch --description="" &&
18 test_must_fail git config --get branch.master.description
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"
30 'Remove stgit branch description' '
32 test_must_fail git config --get branch.foo.description
36 'Describe non-current branch' '
37 stg branch --clone bar &&
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"
46 command_error stg branch -d "a description" bar foo 2>&1 |
47 grep -e "incorrect number of arguments"
51 'Check descriptions in list' '
52 stg branch --list > 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 +| "