diff --git a/poetry/vcs/git.py b/poetry/vcs/git.py index 791e68dd1af..28b8de74c2b 100644 --- a/poetry/vcs/git.py +++ b/poetry/vcs/git.py @@ -229,7 +229,9 @@ def rev_parse(self, rev, folder=None): # type: (...) -> str folder.as_posix(), ] - args += ["rev-parse", rev] + # We need "^{commit}" to ensure that the commit SHA of the commit the + # tag points to is returned, even in the case of annotated tags. + args += ["rev-parse", rev + "^{commit}"] return self.run(*args)