tg.sh: handle help -h
[topgit/pro.git] / t / t2020-hook-bare-branches.sh
blobbe078850f4a4d2aa5a8a5ea127d7d95252d241cd
1 #!/bin/sh
3 test_description='verify hook support for bare branches'
5 . ./test-lib.sh
7 test_plan 6
9 # makes sure tg_test_setup_topgit will work on non-bin-wrappers testees
10 PATH="${TG_TEST_FULL_PATH%/*}:$PATH" && export PATH
12 test_expect_success 'setup' '
13 tg_test_setup_topgit &&
14 test_commit base &&
15 tg_test_create_branch tgb ::master &&
16 test_tick && test_when_finished test_tick=$test_tick &&
17 git checkout tgb
20 test_expect_success 'new bare commit allowed' '
21 test_commit "commit on already bare branch should work" xyz
24 test_expect_success 'setup tag' '
25 git tag start
28 test_expect_success 'bare forbids adding .topdeps' '
29 git reset --hard start &&
30 echo master >.topdeps &&
31 git add .topdeps &&
32 test_must_fail git commit -m "add .topdeps"
35 test_expect_success 'bare forbids adding .topmsg' '
36 git reset --hard start &&
37 echo foo >.topmsg &&
38 git add .topmsg &&
39 test_must_fail git commit -m "add .topmsg"
42 test_expect_success 'bare allows adding .topdeps & .topmsg' '
43 git reset --hard start &&
44 echo foo >.topmsg &&
45 git add .topmsg &&
46 echo master >.topdeps &&
47 git add .topdeps &&
48 git commit -m "add .topdeps & .topmsg"
51 test_done