aboutsummaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-10-22 01:49:45 -0500
committerJunio C Hamano <gitster@pobox.com>2010-10-22 11:04:53 -0700
commitda53eec68873e76c68086e405f3f1329d47055b3 (patch)
tree750c54e71333132ec43e222f0bd202ee7b855b61 /t/t7600-merge.sh
parentcbb3167ef8b73109ed5c5e54aa1915d9c50f83d5 (diff)
downloadgit-da53eec68873e76c68086e405f3f1329d47055b3.tar.gz
git-da53eec68873e76c68086e405f3f1329d47055b3.tar.xz
merge -h: show usage even with corrupt index
Part of a campaign to make sure "git <command> -h" works correctly when run from distractingly bad repositories. [jn: with rewritten log message and tests] Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index b4f40e4c3..b147a1bd6 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -144,6 +144,17 @@ test_expect_success 'test option parsing' '
test_must_fail git merge
'
+test_expect_success 'merge -h with invalid index' '
+ mkdir broken &&
+ (
+ cd broken &&
+ git init &&
+ >.git/index &&
+ test_expect_code 129 git merge -h 2>usage
+ ) &&
+ grep "[Uu]sage: git merge" broken/usage
+'
+
test_expect_success 'reject non-strategy with a git-merge-foo name' '
test_must_fail git merge -s index c1
'