]>
Commit | Line | Data |
---|---|---|
a3b427b9 AW |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Amos Waterland | |
4 | # | |
5 | ||
6 | test_description='git branch --foo should not create bogus branch | |
7 | ||
8 | This test runs git branch --help and checks that the argument is properly | |
9 | handled. Specifically, that a bogus branch is not created. | |
10 | ' | |
11 | . ./test-lib.sh | |
12 | ||
13 | test_expect_success \ | |
14 | 'prepare an trivial repository' \ | |
15 | 'echo Hello > A && | |
bc6146d2 JH |
16 | git-update-index --add A && |
17 | git-commit -m "Initial commit."' | |
a3b427b9 | 18 | |
aa9dc7af JH |
19 | test_expect_success \ |
20 | 'git branch --help should return success now.' \ | |
bc6146d2 | 21 | 'git-branch --help' |
a3b427b9 AW |
22 | |
23 | test_expect_failure \ | |
24 | 'git branch --help should not have created a bogus branch' \ | |
25 | 'test -f .git/refs/heads/--help' | |
26 | ||
08db81a9 AR |
27 | test_expect_success \ |
28 | 'git branch abc should create a branch' \ | |
29 | 'git-branch abc && test -f .git/refs/heads/abc' | |
30 | ||
31 | test_expect_success \ | |
32 | 'git branch a/b/c should create a branch' \ | |
33 | 'git-branch a/b/c && test -f .git/refs/heads/a/b/c' | |
34 | ||
a3b427b9 | 35 | test_done |