]> Kevux Git Server - rit/commit
push: don't fetch commit object when checking existence
authorTom Hughes <tom@compton.nu>
Wed, 22 May 2024 20:15:40 +0000 (21:15 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 22 May 2024 20:46:08 +0000 (13:46 -0700)
commit6549c41ead833c8d8c4098806a29399433065516
tree829995e182cf0991f8a12baee6dd3e9926bfceaf
parent786a3e4b8d754d2b14b1208b98eeb0a554ef19a8
push: don't fetch commit object when checking existence

If we're checking to see whether to tell the user to do a fetch
before pushing there's no need for us to actually fetch the object
from the remote if the clone is partial.

Because the promisor doesn't do negotiation actually trying to do
the fetch of the new head can be very expensive as it will try and
include history that we already have and it just results in rejecting
the push with a different message, and in behavior that is different
to a clone that is not partial.

Signed-off-by: Tom Hughes <tom@compton.nu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c
t/t0410-partial-clone.sh