summaryrefslogtreecommitdiff
path: root/tag.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-02 22:30:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-02 22:30:46 (GMT)
commit09ca61304986395352594b08acab3d161fdbd81b (patch)
tree014f11aba1f8773a3554b45a97948bb74fd72ca5 /tag.c
parent7c85ee6c5818f4409a29e40cc406ef5db9560af8 (diff)
parent8c4cc326896de1a1501135c529b0596fa6327969 (diff)
downloadgit-09ca61304986395352594b08acab3d161fdbd81b.zip
git-09ca61304986395352594b08acab3d161fdbd81b.tar.gz
git-09ca61304986395352594b08acab3d161fdbd81b.tar.bz2
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
Diffstat (limited to 'tag.c')
-rw-r--r--tag.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tag.c b/tag.c
index 94a89b2..1db663d 100644
--- a/tag.c
+++ b/tag.c
@@ -6,6 +6,7 @@
#include "blob.h"
#include "alloc.h"
#include "gpg-interface.h"
+#include "packfile.h"
const char *tag_type = "tag";
@@ -66,12 +67,18 @@ int gpg_verify_tag(const struct object_id *oid, const char *name_to_report,
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(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);