t5408: expect client-side error for duplicate destinations
Update the error message expectation for the existing t5408 tests that use send-pack to transmit duplicate updates to an empty remote, and toggle them test_expect_failure. The tests previously asserted the server-side rejection "multiple updates for ref '<dst>' not allowed". The next commit rejects these pushes on the client-side such that send-pack fails earlier with "dst ref <dst> receives from more than one src", and never reaches the server. The tests are toggled to test_expect_success then. While here, change the test descriptions to note that they are no longer asserting anything about the order of partial ref updates. Also included is a fix for a missing "2>err" in the '--stdin refs come after cmdline' test. Signed-off-by: Jon Simons <jon@jonsimons.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>seen
parent
be48597343
commit
97bf6f3552
|
|
@ -97,25 +97,25 @@ test_expect_success '--stdin refs are sent after cmdline refs' '
|
|||
verify_push A bar
|
||||
'
|
||||
|
||||
test_expect_success 'cmdline refs written in order' '
|
||||
test_expect_failure 'two cmdline refs for the same destination are rejected' '
|
||||
clear_remote &&
|
||||
test_must_fail git send-pack remote.git A:foo B:foo 2>err &&
|
||||
test_grep "multiple updates for ref ${SQ}refs/heads/foo${SQ} not allowed" err &&
|
||||
test_grep "dst ref refs/heads/foo receives from more than one src" err &&
|
||||
test_must_fail git --git-dir=remote.git rev-parse foo
|
||||
'
|
||||
|
||||
test_expect_success 'cmdline refs with multiple duplicates' '
|
||||
test_expect_failure 'three cmdline refs for the same destination are rejected' '
|
||||
clear_remote &&
|
||||
test_must_fail git send-pack remote.git A:foo B:foo C:foo 2>err &&
|
||||
test_grep "multiple updates for ref ${SQ}refs/heads/foo${SQ} not allowed" err &&
|
||||
test_grep "dst ref refs/heads/foo receives from more than one src" err &&
|
||||
test_must_fail git --git-dir=remote.git rev-parse foo
|
||||
'
|
||||
|
||||
test_expect_success '--stdin refs come after cmdline' '
|
||||
test_expect_failure 'cmdline and --stdin refs for the same destination are rejected' '
|
||||
clear_remote &&
|
||||
echo A:foo >input &&
|
||||
test_must_fail git send-pack remote.git --stdin B:foo <input &&
|
||||
test_grep "multiple updates for ref ${SQ}refs/heads/foo${SQ} not allowed" err &&
|
||||
test_must_fail git send-pack remote.git --stdin B:foo <input 2>err &&
|
||||
test_grep "dst ref refs/heads/foo receives from more than one src" err &&
|
||||
test_must_fail git --git-dir=remote.git rev-parse foo
|
||||
'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue