diff options
| author | Mahi Kassa <mahlet.takassa@gmail.com> | 2026-03-25 12:51:48 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-25 10:35:27 -0700 |
| commit | abd728cdf6ea0164cfd7ede2223f669037ff531d (patch) | |
| tree | ac1ceebea258ab8a1b8ba55b4ceb4e5df4d92d89 /t | |
| parent | 4be77c732c9951a60f743af04a5906fdc41c5795 (diff) | |
| download | git-abd728cdf6ea0164cfd7ede2223f669037ff531d.tar.xz | |
repo: show subcommand-specific help text
Use subcommand-specific usage arrays for "git repo info" and
"git repo structure" so that each command shows only its own
synopsis in help output.
Add tests to cover the subcommand help behavior.
Signed-off-by: Mahi Kassa <mahlet.takassa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
| -rwxr-xr-x | t/t1900-repo-info.sh | 6 | ||||
| -rwxr-xr-x | t/t1901-repo-structure.sh | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/t/t1900-repo-info.sh b/t/t1900-repo-info.sh index a9eb07abe8..39bb77dda0 100755 --- a/t/t1900-repo-info.sh +++ b/t/t1900-repo-info.sh @@ -149,4 +149,10 @@ test_expect_success 'git repo info --keys uses lines as its default output forma test_cmp expect actual ' +test_expect_success 'git repo info -h shows only repo info usage' ' + test_must_fail git repo info -h >actual && + test_grep "git repo info" actual && + test_grep ! "git repo structure" actual +' + test_done diff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh index 98921ce1cb..10050abd70 100755 --- a/t/t1901-repo-structure.sh +++ b/t/t1901-repo-structure.sh @@ -224,4 +224,10 @@ test_expect_success 'progress meter option' ' ) ' +test_expect_success 'git repo structure -h shows only repo structure usage' ' + test_must_fail git repo structure -h >actual && + test_grep "git repo structure" actual && + test_grep ! "git repo info" actual +' + test_done |
