When building the packfile to be sent, send_pack() is given a list of
remote refs to be used as exclusions. For each ref, it first checks if
the ref exists locally, and if it does, passes it with a "^" prefix to
pack-objects. However, in a partial clone, the check may trigger a lazy
fetch. Ensure that this lazy fetch does not occur.

Signed-off-by: Jonathan Tan <jonathanta...@google.com>
 send-pack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/send-pack.c b/send-pack.c
index 6dc16c3211..34c77cbb1a 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -40,7 +40,8 @@ int option_parse_push_signed(const struct option *opt,
 static void feed_object(const struct object_id *oid, FILE *fh, int negative)
-       if (negative && !has_object_file(oid))
+       if (negative &&
+           !has_object_file_with_flags(oid, OBJECT_INFO_SKIP_FETCH_OBJECT))
        if (negative)

Reply via email to