Signed-off-by: Teng Long <dyroneteng@xxxxxxxxx> --- commit.h | 5 +++++ revision.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/commit.h b/commit.h index df42eb434f..1e99e9ae8a 100644 --- a/commit.h +++ b/commit.h @@ -38,6 +38,11 @@ struct commit { */ struct tree *maybe_tree; unsigned int index; + /* + * wrapped tags or NULL. If the commit is peeled from tag(s), + * then save the wraps, otherwise will be NULL. + */ + struct object_list *wraps; }; extern int save_commit_buffer; diff --git a/revision.c b/revision.c index 65e0926d25..aecf493f46 100644 --- a/revision.c +++ b/revision.c @@ -416,14 +416,17 @@ static struct commit *handle_commit(struct rev_info *revs, const char *path = entry->path; unsigned int mode = entry->mode; unsigned long flags = object->flags; - + struct object_list *wraps = NULL; /* * Tag object? Look what it points to.. */ while (object->type == OBJ_TAG) { struct tag *tag = (struct tag *) object; - if (revs->tag_objects && !(flags & UNINTERESTING)) + if (revs->tag_objects && !(flags & UNINTERESTING)) { + object_list_insert(object, &wraps); add_pending_object(revs, object, tag->tag); + } + object = parse_object(revs->repo, get_tagged_oid(tag)); if (!object) { if (revs->ignore_missing_links || (flags & UNINTERESTING)) @@ -449,6 +452,7 @@ static struct commit *handle_commit(struct rev_info *revs, */ if (object->type == OBJ_COMMIT) { struct commit *commit = (struct commit *)object; + commit->wraps = wraps; if (repo_parse_commit(revs->repo, commit) < 0) die("unable to parse commit %s", name); -- 2.31.1.456.gec51e24953