Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not get tags with allTagsWithError #684

Open
Whirlwind opened this issue Jan 3, 2019 · 0 comments
Open

Could not get tags with allTagsWithError #684

Whirlwind opened this issue Jan 3, 2019 · 0 comments

Comments

@Whirlwind
Copy link

Whirlwind commented Jan 3, 2019

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 :


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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant