]> git.ipfire.org Git - thirdparty/git.git/commit
push: test that <src> doesn't DWYM if <dst> is unqualified
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 13 Nov 2018 19:52:44 +0000 (19:52 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Nov 2018 06:27:55 +0000 (15:27 +0900)
commitbf70636fd7b9014e7320260b0221c84061447917
treedd4f57ea366bd18e877b9dcbc2d775d5fdfd7f38
parentdd8dd300c636bf0a1352379aed88d9434a6ac7bb
push: test that <src> doesn't DWYM if <dst> is unqualified

Add a test asserting that "git push origin <src>:<dst>" where <src> is
a branch, tag, tree or blob in refs/remotes/* doesn't DWYM when <dst>
is unqualified. This has never been the case, but there haven't been
any tests for this behavior.

See f88395ac23 ("Renaming push.", 2005-08-03), bb9fca80ce ("git-push:
Update description of refspecs and add examples", 2007-06-09) and
f8aae12034 ("push: allow unqualified dest refspecs to DWIM",
2008-04-23) which are most relevant commits that have changed or
documented the behavior of the DWYM feature in the past.

These tests were originally meant to lead up to a patch that made
refs/remotes/* on the LHS imply refs/heads/* on the RHS, see [1]. That
patch proved controversial and may not ever land in git.git, but we
should have the tests that remind us what the current behavior is in
case it's ever changed.

1. https://public-inbox.org/git/20181026230741.23321-8-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5505-remote.sh