From: Dmitry Potapov Date: Sun, 3 Aug 2008 14:36:18 +0000 (+0400) Subject: correct argument checking test for git hash-object X-Git-Tag: v1.6.1-rc1~340^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=81014073f22736e9dcb9370475af44e67234622f;p=git.git correct argument checking test for git hash-object Because the file name given to stdin did not exist, git hash-object fails to open it and exits with non-zero error code. Thus the test may pass even if there is an error in argument checking. Signed-off-by: Dmitry Potapov Signed-off-by: Junio C Hamano --- diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh index 1ec053513..6d505fafe 100755 --- a/t/t1007-hash-object.sh +++ b/t/t1007-hash-object.sh @@ -49,16 +49,16 @@ setup_repo # Argument checking test_expect_success "multiple '--stdin's are rejected" ' - test_must_fail git hash-object --stdin --stdin < example + echo example | test_must_fail git hash-object --stdin --stdin ' test_expect_success "Can't use --stdin and --stdin-paths together" ' - test_must_fail git hash-object --stdin --stdin-paths && - test_must_fail git hash-object --stdin-paths --stdin + echo example | test_must_fail git hash-object --stdin --stdin-paths && + echo example | test_must_fail git hash-object --stdin-paths --stdin ' test_expect_success "Can't pass filenames as arguments with --stdin-paths" ' - test_must_fail git hash-object --stdin-paths hello < example + echo example | test_must_fail git hash-object --stdin-paths hello ' # Behavior