3 # Copyright (c) 2005 Amos Waterland
6 test_description
='git branch --foo should not create bogus branch
8 This test runs git branch --help and checks that the argument is properly
9 handled. Specifically, that a bogus branch is not created.
14 'prepare an trivial repository' \
16 git-update-index --add A &&
17 git-commit -m "Initial commit." &&
18 HEAD=$(git-rev-parse --verify HEAD)'
21 'git branch --help should not have created a bogus branch' \
22 'git-branch --help </dev/null >/dev/null 2>/dev/null || :
23 test -f .git/refs/heads/--help'
26 'git branch abc should create a branch' \
27 'git-branch abc && test -f .git/refs/heads/abc'
30 'git branch a/b/c should create a branch' \
31 'git-branch a/b/c && test -f .git/refs/heads/a/b/c'
34 0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master
37 'git branch -l d/e/f should create a branch and a log' \
38 'GIT_COMMITTER_DATE="2005-05-26 23:30" \
39 git-branch -l d/e/f &&
40 test -f .git/refs/heads/d/e/f &&
41 test -f .git/logs/refs/heads/d/e/f &&
42 diff expect .git/logs/refs/heads/d/e/f'
45 'git branch -d d/e/f should delete a branch and a log' \
46 'git-branch -d d/e/f &&
47 test ! -f .git/refs/heads/d/e/f &&
48 test ! -f .git/logs/refs/heads/d/e/f'
51 0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 checkout: Created from master^0
54 'git checkout -b g/h/i -l should create a branch and a log' \
55 'GIT_COMMITTER_DATE="2005-05-26 23:30" \
56 git-checkout -b g/h/i -l master &&
57 test -f .git/refs/heads/g/h/i &&
58 test -f .git/logs/refs/heads/g/h/i &&
59 diff expect .git/logs/refs/heads/g/h/i'
62 'git branch j/k should work after branch j has been deleted' \
68 'git branch l should work after branch l/m has been deleted' \