import nimgit2 import types, free, utils, objects proc lookupTag* (repo: GitRepository, id: GitObjectId): GitTag = let error = git_tag_lookup(addr result, repo, id) if error != 0: free(result) raise newException(CatchableError, "Tag lookup failed: " & $error.getResultCode) proc type* (obj: GitTag): GitObjectKind = cast[GitObject](obj).type proc owner* (tag: GitTag): GitRepository = git_tag_owner(tag) proc id* (tag: GitTag): GitObjectId = git_tag_id(tag) proc shortId* (tag: GitTag): string = cast[GitObject](tag).shortId() proc name* (tag: GitTag): string = $git_tag_name(tag) proc message* (tag: GitTag): string = $git_tag_message(tag) proc tagger* (tag: GitTag): GitSignature = git_tag_tagger(tag).parseGitSignature proc copy* (tag: GitTag): GitTag = let error = git_tag_dup(addr result, tag) if error != 0: free(result) raise newException(CatchableError, "Cannot copy GitTag: " & $error.getResultCode) proc target* (tag: GitTag): GitObject = let error = git_tag_target(addr result, tag) if error != 0: free(result) raise newException(CatchableError, "Cannot get target object: " & $error.getResultCode) proc targetId* (tag: GitTag): GitObjectId = git_tag_target_id(tag) proc peelTarget* (tag: GitTag): GitObject = let error = git_tag_peel(addr result, tag) if error != 0: free(result) raise newException(CatchableError, "Tag peel failed: " & $error.getResultCode) proc targetType* (tag: GitTag): GitObjectKind = cast[GitObjectKind](git_tag_target_type(tag))