Skip to content

Commit f032d66

Browse files
committed
request-pull: do not emit "tag" before the tagname
The whole point of the recent update to allow "git pull $url $tagname" is so that the integrator does not have to store the (signed) tag that is used to convey authenticity to be recorded in the resulting merge in the local repository's tag namespace. Asking for a merge be made with "git pull $url tag $tagname" defeats it. Note that the request can become ambiguous if the requestor has a branch with the same name as the tag, but that is not a new problem limited to pulling. I wouldn't mind if somebody wants to add disambiguation to the find_matching_ref logic in the script as a separate patch, though. Signed-off-by: Junio C Hamano <[email protected]>
1 parent fe46fa9 commit f032d66

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

git-request-pull.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ die "fatal: No commits in common between $base and $head"
6363
find_matching_ref='
6464
sub abbr {
6565
my $ref = shift;
66-
if ($ref =~ s|refs/heads/||) {
66+
if ($ref =~ s|refs/heads/|| || $ref =~ s|refs/tags/||) {
6767
return $ref;
68-
} elsif ($ref =~ s|refs/tags/||) {
69-
return "tag $ref";
7068
} else {
7169
return $ref;
7270
}

t/t5150-request-pull.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ test_expect_success 'request names an appropriate branch' '
180180
read branch
181181
} <digest &&
182182
{
183-
test "$branch" = tag--full ||
183+
test "$branch" = full ||
184184
test "$branch" = master ||
185185
test "$branch" = for-upstream
186186
}

0 commit comments

Comments
 (0)