]> Pileus Git - ~andy/git/commit
push: also use "upstream" mapping when pushing a single ref
authorJunio C Hamano <gitster@pobox.com>
Wed, 4 Dec 2013 00:23:35 +0000 (16:23 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Dec 2013 23:12:34 +0000 (15:12 -0800)
commitfc9261ca611080b1dae76b86b3bf5f36d592042f
treec9ec7196e858e2a55067d02ec1e118c3800f8554
parentca02465b41311fe7634acb9bb5b5c61975ef5f38
push: also use "upstream" mapping when pushing a single ref

When the user is using the 'upstream' mode, these commands:

    $ git push
    $ git push origin

would find the 'upstream' branch for the current branch, and then
push the current branch to update it.  However, pushing a single
branch explicitly, i.e.

    $ git push origin $(git symbolic-ref --short HEAD)

would not go through the same ref mapping process, and ends up
updating the branch at 'origin' of the same name, which may not
necessarily be the upstream of the branch being pushed.

In the spirit similar to the previous one, map a colon-less refspec
using the upstream mapping logic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/push.c
t/t5516-fetch-push.sh