Re: [PATCH v2 08/12] remote: reject duplicate destinations on an empty remote
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 5, 2026, 22:32 UTC
- Message-ID
- <xmqqqzgyq58d.fsf@gitster.g>
- In-Reply-To
- <20261014031347.50433-9-jon@jonsimons.org>
Jon Simons <jon@jonsimons.org> writes:
Show 36 quoted lines
> diff --git a/t/t5408-send-pack-stdin.sh b/t/t5408-send-pack-stdin.sh
> index 7af350f01c..1e34880323 100755
> --- a/t/t5408-send-pack-stdin.sh
> +++ b/t/t5408-send-pack-stdin.sh
> @@ -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_success '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_success '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_success '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
> 'So these were already failing, and the only changes are the messaging?
Regardless, making sure that a push or a fetch that updates the same thing in a potentially conflicting way fails is a very welcome change.