Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit d952cbb

Browse files
committed
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 <[email protected]>
1 parent ec44507 commit d952cbb

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

git-request-pull.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ then
118118
status=1
119119
fi
120120

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+
121127
url=$(git ls-remote --get-url "$url")
122128

123129
git show -s --format='The following changes since commit %H:

t/t5150-request-pull.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,13 @@ test_expect_success 'pull request format' '
223223
git request-pull initial "$downstream_url" tags/full:refs/tags/full
224224
) >request &&
225225
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$'
227233
'
228234

229235
test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '

0 commit comments

Comments
 (0)