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>

Junio C Hamano committed May 16, 2014 at 10:18 UTC d952cbb1908b54c6a04f37c8b0924a49cdb5997d
2 files changed +13 -1
git-request-pull.sh
+6
@@ -118,6 +118,12 @@ then
118 status=1
119 fi
120
121 +# Special case: turn "for_linus" to "tags/for_linus" when it is correct
122 +if test "$ref" = "refs/tags/$pretty_remote"
123 +then
124 + pretty_remote=tags/$pretty_remote
125 +fi
126 +
127 url=$(git ls-remote --get-url "$url")
128
129 git show -s --format='The following changes since commit %H:
t/t5150-request-pull.sh
+7 -1
@@ -223,7 +223,13 @@ test_expect_success 'pull request format' '
223 git request-pull initial "$downstream_url" tags/full:refs/tags/full
224 ) >request &&
225 sed -nf fuzz.sed <request >request.fuzzy &&
226 - test_i18ncmp expect request.fuzzy
226 + test_i18ncmp expect request.fuzzy &&
227 +
228 + (
229 + cd local &&
230 + git request-pull initial "$downstream_url" full
231 + ) >request &&
232 + grep ' tags/full$'
233 '
234
235 test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '