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

Commit 5aae66b

Browse files
committed
request-pull: resurrect "pretty refname" feature
When asking to fetch/pull a branch whose name is B or a tag whose name is T, we used to show the command to run as: git pull $URL B git pull $URL tags/T even when B and T were spelled in a more qualified way in order to disambiguate, e.g. heads/B or refs/tags/T, but the recent update lost this feature. Resurrect it. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 28ad685 commit 5aae66b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

git-request-pull.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ fi
5353
local=${3%:*}
5454
local=${local:-HEAD}
5555
remote=${3#*:}
56+
pretty_remote=${remote#refs/}
57+
pretty_remote=${pretty_remote#heads/}
5658
head=$(git symbolic-ref -q "$local")
5759
head=${head:-$(git show-ref --heads --tags "$local" | cut -d' ' -f2)}
5860
head=${head:-$(git rev-parse --quiet --verify "$local")}
@@ -124,7 +126,7 @@ git show -s --format='The following changes since commit %H:
124126
125127
are available in the git repository at:
126128
' $merge_base &&
127-
echo " $url $remote" &&
129+
echo " $url $pretty_remote" &&
128130
git show -s --format='
129131
for you to fetch changes up to %H:
130132

t/t5150-request-pull.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,14 @@ test_expect_success 'pull request format' '
216216
git request-pull initial "$downstream_url" tags/full >../request
217217
) &&
218218
<request sed -nf fuzz.sed >request.fuzzy &&
219-
test_i18ncmp expect request.fuzzy
219+
test_i18ncmp expect request.fuzzy &&
220220
221+
(
222+
cd local &&
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
221227
'
222228

223229
test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '

0 commit comments

Comments
 (0)