From 8bbf311ef4caab442d1c3e5f12eebd8a7c4e541b Mon Sep 17 00:00:00 2001 From: Julien Lhermitte <705366+jrmlhermitte@users.noreply.github.com> Date: Fri, 21 Feb 2020 09:53:17 -0500 Subject: [PATCH] fix(git): get commit sha of git commit from annotated tags (#1948) * fix(git): have annotated tags resolve to the commit sha * fix(git): fix quote * fix(git): change to rev-parse --- poetry/vcs/git.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)