Server side (non-trac) commit message enforcement.
[git-central.git] / tests / t1000-commit-msg-ticket-hook.sh
1 #!/bin/sh
2
3 test_description='client commit-msg ticket enforcer'
4
5 . ./test-lib.sh
6
7 # setup the commit-msg hook
8 install_client_hook 'commit-msg' 'commit-msg'
9
10 test_expect_success 'rejects with bad message' '
11         echo "$test_name" > file &&
12         git add file &&
13         ! git commit -m "first"
14 '
15
16 test_expect_success 'rejects with re:' '
17         echo "$test_name" > file &&
18         git add file &&
19         ! git commit -m "first re: #3200"
20 '
21
22 test_expect_success 'rejects with re no space' '
23         echo "$test_name" > file &&
24         git add file &&
25         ! git commit -m "first re#3200"
26 '
27
28 test_expect_success 'accepts with re' '
29         echo "$test_name" > file &&
30         git add file &&
31         git commit -m "first re #3200"
32 '
33
34 test_expect_success 'accepts with RE' '
35         echo "$test_name" > file &&
36         git add file &&
37         git commit -m "first RE #3200"
38 '
39
40 test_expect_success 'accepts with refs' '
41         echo "$test_name" > file &&
42         git add file &&
43         git commit -m "first refs #3200"
44 '
45
46 test_expect_success 'accepts with qa' '
47         echo "$test_name" > file &&
48         git add file &&
49         git commit -m "first qa #3200"
50 '
51
52 test_expect_success 'accepts with no ticket' '
53         echo "$test_name" > file &&
54         git add file &&
55         git commit -m "first no ticket"
56 '
57
58 test_done
59