From f30f49e57f29a2ba62a2a23d894d59d03a207af4 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Wed, 29 Jun 2016 17:51:10 +0100 Subject: fix handling of annotated tags pygit2.revparse_single(annotated_tag) returns a pygit2.Tag object, and this extra layer of indirection has to be resolved to obtain the pygit2.Commit. --- git_deps/detector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git_deps/detector.py b/git_deps/detector.py index 1f470ee..4de1282 100644 --- a/git_deps/detector.py +++ b/git_deps/detector.py @@ -80,7 +80,10 @@ class DependencyDetector(object): return self.commits[rev] try: - self.commits[rev] = self.repo.revparse_single(rev) + commit = self.repo.revparse_single(rev) + if isinstance(commit, pygit2.Tag): + commit = commit.get_object() + self.commits[rev] = commit except (KeyError, ValueError): raise InvalidCommitish(rev) -- cgit