correct argument checking test for git hash-object
authorDmitry Potapov <dpotapov@gmail.com>
Sun, 3 Aug 2008 14:36:18 +0000 (18:36 +0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 3 Aug 2008 20:22:57 +0000 (13:22 -0700)
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 <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1007-hash-object.sh
index 1ec0535138c72bbd1e497c35c21bc5ea46b0315f..6d505fafeb1c41bec93db82a5f2a66f3f65b623c 100755 (executable)
@@ -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