From: Junio C Hamano Date: Thu, 2 Aug 2018 22:30:46 +0000 (-0700) Subject: Merge branch 'jt/tags-to-promised-blobs-fix' X-Git-Tag: v2.19.0-rc0~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09ca61304986395352594b08acab3d161fdbd81b;p=git Merge branch 'jt/tags-to-promised-blobs-fix' The lazy clone support had a few places where missing but promised objects were not correctly tolerated, which have been fixed. * jt/tags-to-promised-blobs-fix: tag: don't warn if target is missing but promised revision: tolerate promised targets of tags --- 09ca61304986395352594b08acab3d161fdbd81b diff --cc tag.c index 94a89b21cb,1110e3643e..1db663d716 --- a/tag.c +++ b/tag.c @@@ -4,8 -3,8 +4,9 @@@ #include "commit.h" #include "tree.h" #include "blob.h" +#include "alloc.h" #include "gpg-interface.h" + #include "packfile.h" const char *tag_type = "tag"; @@@ -64,14 -63,20 +65,20 @@@ int gpg_verify_tag(const struct object_ return ret; } -struct object *deref_tag(struct object *o, const char *warn, int warnlen) +struct object *deref_tag(struct repository *r, struct object *o, const char *warn, int warnlen) { + struct object_id *last_oid = NULL; while (o && o->type == OBJ_TAG) - if (((struct tag *)o)->tagged) - o = parse_object(r, &((struct tag *)o)->tagged->oid); - else + if (((struct tag *)o)->tagged) { + last_oid = &((struct tag *)o)->tagged->oid; - o = parse_object(last_oid); ++ o = parse_object(r, last_oid); + } else { + last_oid = NULL; o = NULL; + } if (!o && warn) { + if (last_oid && is_promisor_object(last_oid)) + return NULL; if (!warnlen) warnlen = strlen(warn); error("missing object referenced by '%.*s'", warnlen, warn);