提交 81014073 编写于 作者: D Dmitry Potapov 提交者: Junio C Hamano

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: NDmitry Potapov <dpotapov@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 43df4f86
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册