request-pull: allow "local:remote" to specify names on both ends
This allows a user to say that a local branch has a different name on
the remote server, using the same syntax that "git push" uses to create
that situation.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Linus Torvalds11 years agocommitted byJunio C Hamano
test -z "$headrev" && die "fatal: Ambiguous revision: $3"
test -z "$headrev" && die "fatal: Ambiguous revision: $local"
# Was it a branch with a description?
branch_name=${head#refs/heads/}
@ -69,9 +73,6 @@ then
@@ -69,9 +73,6 @@ then
branch_name=
fi
prettyhead=${head#refs/}
prettyhead=${prettyhead#heads/}
merge_base=$(git merge-base $baserev $headrev) ||
die "fatal: No commits in common between $base and $head"
@ -81,30 +82,37 @@ die "fatal: No commits in common between $base and $head"
@@ -81,30 +82,37 @@ die "fatal: No commits in common between $base and $head"
#
# Otherwise find a random ref that matches $headrev.
find_matching_ref='
my ($exact,$found);
my ($head,$headrev) = (@ARGV);
my ($found);
while (<STDIN>) {
chomp;
my ($sha1, $ref, $deref) = /^(\S+)\s+([^^]+)(\S*)$/;
echo "warn: No match for $prettyhead found at $url" >&2
echo "warn: Are you sure you pushed '$prettyhead' there?" >&2
echo "warn: No match for commit $headrev found at $url" >&2
echo "warn: Are you sure you pushed '${remote:-HEAD}' there?" >&2
status=1
fi
@ -116,7 +124,7 @@ git show -s --format='The following changes since commit %H:
@@ -116,7 +124,7 @@ git show -s --format='The following changes since commit %H: