Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-04-04 20:56:21 +0300
committerJunio C Hamano <gitster@pobox.com>2022-04-04 20:56:21 +0300
commit3ff8cbfe8a333f55931fa9b588f106e060a67079 (patch)
treed4096bb40c2513a46d6dfd4ecbbbe219c158a683 /t/t1410-reflog.sh
parent4b6846d9dcd391164b72bd70e8a0c0e09776afe3 (diff)
parent840344db7578a794fd25c44587e4a08dfe4f41cc (diff)
Merge branch 'ab/reflog-parse-options'
"git reflog" command now uses parse-options API to parse its command line options. * ab/reflog-parse-options: reflog: fix 'show' subcommand's argv reflog [show]: display sensible -h output reflog: convert to parse_options() API reflog exists: use parse_options() API git reflog [expire|delete]: make -h output consistent with SYNOPSIS reflog: move "usage" variables and use macros reflog tests: add missing "git reflog exists" tests reflog: refactor cmd_reflog() to "if" branches reflog.c: indent argument lists
Diffstat (limited to 't/t1410-reflog.sh')
-rwxr-xr-xt/t1410-reflog.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index ea8e6ac2a0..aa59954f6c 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -106,6 +106,28 @@ test_expect_success setup '
test_line_count = 4 output
'
+test_expect_success 'correct usage on sub-command -h' '
+ test_expect_code 129 git reflog expire -h >err &&
+ grep "git reflog expire" err
+'
+
+test_expect_success 'correct usage on "git reflog show -h"' '
+ test_expect_code 129 git reflog show -h >err &&
+ grep -F "git reflog [show]" err
+'
+
+test_expect_success 'pass through -- to sub-command' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo message --a-file contents dash-tag &&
+
+ git -C repo reflog show -- --does-not-exist >out &&
+ test_must_be_empty out &&
+ git -C repo reflog show >expect &&
+ git -C repo reflog show -- --a-file >actual &&
+ test_cmp expect actual
+'
+
test_expect_success rewind '
test_tick && git reset --hard HEAD~2 &&
test -f C &&