Merge branch 'jt/tags-to-promised-blobs-fix'
authorJunio C Hamano <gitster@pobox.com>
Thu, 2 Aug 2018 22:30:46 +0000 (15:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Aug 2018 22:30:46 +0000 (15:30 -0700)
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

1  2 
revision.c
tag.c
diff --cc revision.c
Simple merge
diff --cc tag.c
index 94a89b21cb5bdeda2f8c395a7c647bf165821849,1110e3643ef5c451681fa395fcc36d3054fd4c52..1db663d71623a493286c90b13532c7d1cf73f517
--- 1/tag.c
--- 2/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);