Re: Friendly refspecs
- From
Jeff King <peff@peff.net>
- Date
- Apr 23, 2008, 09:21 UTC
- Message-ID
- <20080423092144.GA11368@sigill.intra.peff.net>
- In-Reply-To
- <20080423091606.GC11935@sigill.intra.peff.net>
On Wed, Apr 23, 2008 at 05:16:06AM -0400, Jeff King wrote:
Show 5 quoted lines
> > Historically we did not favor one way or another for the general purpose > > syntax. I think Jeff's proposed heuristics to favor branch if a branch > > tip is pushed and tag if a tag is pushed makes sense. > > OK, here is a cleaned up patch with tests.
Oops, I forgot to mention: there is a broken test in t5516 that is revealed by this change. The patch below should be applied before the DWIM one.
-- >8 -- t5516: remove ambiguity test (1)
This test tried to push into a remote with ambiguous refs in remotes/$x/master and remotes/$y/master. However, the remote never actually tells us about the refs/remotes hierarchy, so we don't even see this ambiguity.
The test happened to pass because we were simply looking for failure, and the test fails for another reason: the dst refspec does not exist and does not begin with refs/, making it invalid.
Signed-off-by: Jeff King <peff@peff.net> --- t/t5516-fetch-push.sh | 14 +------------- 1 files changed, 1 insertions(+), 13 deletions(-)
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 6d7e738..f93a100 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -209,19 +209,7 @@ test_expect_success 'push with weak ambiguity (2)' ' ' -test_expect_success 'push with ambiguity (1)' ' - - mk_test remotes/origin/master remotes/frotz/master && - if git push testrepo master:master - then - echo "Oops, should have failed" - false - else - check_push_result $the_first_commit remotes/origin/master remotes/frotz/master - fi -' - -test_expect_success 'push with ambiguity (2)' ' +test_expect_success 'push with ambiguity' ' mk_test heads/frotz tags/frotz && if git push testrepo master:frotz
-- 1.5.5.1.69.g9c889.dirty