Merge branch 'os/fetch-check-not-current-branch'
[git/debian.git] / t / t1418-reflog-exists.sh
blobd51ecd5e9250f004e0b0c894b308172237e5666c
1 #!/bin/sh
3 test_description='Test reflog display routines'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7 . ./test-lib.sh
9 test_expect_success 'setup' '
10 test_commit A
13 test_expect_success 'usage' '
14 test_expect_code 129 git reflog exists &&
15 test_expect_code 129 git reflog exists -h
18 test_expect_success 'usage: unknown option' '
19 test_expect_code 129 git reflog exists --unknown-option
22 test_expect_success 'reflog exists works' '
23 git reflog exists refs/heads/main &&
24 test_must_fail git reflog exists refs/heads/nonexistent
27 test_expect_success 'reflog exists works with a "--" delimiter' '
28 git reflog exists -- refs/heads/main &&
29 test_must_fail git reflog exists -- refs/heads/nonexistent
32 test_expect_success 'reflog exists works with a "--end-of-options" delimiter' '
33 git reflog exists --end-of-options refs/heads/main &&
34 test_must_fail git reflog exists --end-of-options refs/heads/nonexistent
37 test_done