Open Whirlwind opened 5 years ago
I have a git repo, and there are some tags in the repo. I use the - [GTRepository allTagsWithError:] could not get any tags.
- [GTRepository allTagsWithError:]
I debug the code, I found that :
static int GTRepositoryForeachTagCallback(const char *name, git_oid *oid, void *payload) { struct GTRepositoryTagEnumerationInfo *info = payload; GTTag *tag = (GTTag *)[info->myself lookUpObjectByGitOid:oid objectType:GTObjectTypeTag error:NULL]; BOOL stop = NO; if (tag != nil) { info->block(tag, &stop); } return stop ? GIT_EUSER : 0; }
The lookUpObjectByGitOid: will return nil.
lookUpObjectByGitOid:
And debug into it, I found the odb_read_1 in libgit2 will find a oid with type GIT_OBJ_COMMIT, it do not match the GIT_OBJ_TAG, so the type is mismatch.
odb_read_1
GIT_OBJ_COMMIT
GIT_OBJ_TAG
I have a git repo, and there are some tags in the repo. I use the
- [GTRepository allTagsWithError:]
could not get any tags.I debug the code, I found that :
The
lookUpObjectByGitOid:
will return nil.And debug into it, I found the
odb_read_1
in libgit2 will find a oid with typeGIT_OBJ_COMMIT
, it do not match theGIT_OBJ_TAG
, so the type is mismatch.