Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
request-pull: resurrect for-linus -> tags/for-linus DWIM
Older versions of Git before v1.7.10 did not DWIM

    $ git pull $URL for-linus

to the tag "tags/for-linus" and the users were required to say

    $ git pull $URL tags/for-linus

instead.  Because newer versions of Git works either way,
request-pull used to show tags/for-linus when asked

    $ git request-pull origin/master $URL for-linus

The recent updates broke this and in the output we see "for-linus"
without the "tags/" prefix.

As v1.7.10 is more than 2 years old, this should matter very little
in practice, but resurrecting it is very simple.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed May 16, 2014
1 parent ec44507 commit d952cbb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions git-request-pull.sh
Expand Up @@ -118,6 +118,12 @@ then
status=1
fi

# Special case: turn "for_linus" to "tags/for_linus" when it is correct
if test "$ref" = "refs/tags/$pretty_remote"
then
pretty_remote=tags/$pretty_remote
fi

url=$(git ls-remote --get-url "$url")

git show -s --format='The following changes since commit %H:
Expand Down
8 changes: 7 additions & 1 deletion t/t5150-request-pull.sh
Expand Up @@ -223,7 +223,13 @@ test_expect_success 'pull request format' '
git request-pull initial "$downstream_url" tags/full:refs/tags/full
) >request &&
sed -nf fuzz.sed <request >request.fuzzy &&
test_i18ncmp expect request.fuzzy
test_i18ncmp expect request.fuzzy &&
(
cd local &&
git request-pull initial "$downstream_url" full
) >request &&
grep ' tags/full$'
'

test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '
Expand Down

0 comments on commit d952cbb

Please sign in to comment.