request-pull: warn if the remote object is not the same as the local one
commit0454220d66581f28b9688bc1b687f52cb9561798
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 28 May 2019 10:15:43 +0000 (28 12:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 May 2019 20:06:25 +0000 (28 13:06 -0700)
treea05a4bc3c0178898c136fb8f89b890a4c8cbe033
parent5731dfce06a19f59aa1be2bd2120584864d8983b
request-pull: warn if the remote object is not the same as the local one

In some cases, git request-pull might be invoked with remote and
local objects that differ even though they point to the same commit.
For example, the remote object might be a lightweight tag
vs. an annotated tag on the local side; or the user might have
reworded the tag locally and forgotten to push it.

When this happens git-request-pull will not warn, because it only
checks that "git ls-remote" returns an SHA1 that matches the local
commit (known as $headrev in the script).  This patch makes
git-request-pull retrieve the tag object SHA1 while processing
the "git ls-remote" output, so that it can be matched against the
local object.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-request-pull.sh
t/t5150-request-pull.sh