]> git.ipfire.org Git - thirdparty/git.git/commitdiff
subtree: t7900: add a test for the -h flag
authorLuke Shumaker <lukeshu@datawire.io>
Tue, 27 Apr 2021 21:17:28 +0000 (15:17 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Apr 2021 07:47:17 +0000 (16:47 +0900)
It's a dumb test, but it's surprisingly easy to break.

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/t/t7900-subtree.sh

index 5c2510f1f527963ffbff33b56b36711da01dc3ea..9afba2f28276395c2fe18e5b853e39e4ef8a48a6 100755 (executable)
@@ -37,6 +37,13 @@ last_commit_subject () {
        git log --pretty=format:%s -1
 }
 
+test_expect_success 'shows short help text for -h' '
+       test_expect_code 129 git subtree -h >out 2>err &&
+       test_must_be_empty err &&
+       grep -e "^ *or: git subtree pull" out &&
+       grep -e --annotate out
+'
+
 #
 # Tests for 'git subtree add'
 #