@matheusbsbs / matheus-bagliano / commits / 81014073f2
Fork 0

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 <dpotapov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Dmitry Potapov committed Aug 3, 2008 at 18:36 UTC 81014073f22736e9dcb9370475af44e67234622f
1 file changed +4 -4
t/t1007-hash-object.sh
+4 -4
@@ -49,16 +49,16 @@ setup_repo
49 # Argument checking
50
51 test_expect_success "multiple '--stdin's are rejected" '
52 - test_must_fail git hash-object --stdin --stdin < example
52 + echo example | test_must_fail git hash-object --stdin --stdin
53 '
54
55 test_expect_success "Can't use --stdin and --stdin-paths together" '
56 - test_must_fail git hash-object --stdin --stdin-paths &&
57 - test_must_fail git hash-object --stdin-paths --stdin
56 + echo example | test_must_fail git hash-object --stdin --stdin-paths &&
57 + echo example | test_must_fail git hash-object --stdin-paths --stdin
58 '
59
60 test_expect_success "Can't pass filenames as arguments with --stdin-paths" '
61 - test_must_fail git hash-object --stdin-paths hello < example
61 + echo example | test_must_fail git hash-object --stdin-paths hello
62 '
63
64 # Behavior