Skip to content

Commit

Permalink
fix(git): get commit sha of git commit from annotated tags (#1948)
Browse files Browse the repository at this point in the history
* fix(git): have annotated tags resolve to the commit sha

* fix(git): fix quote

* fix(git): change to rev-parse
  • Loading branch information
jrmlhermitte authored Feb 21, 2020
1 parent d0a8aed commit 8bbf311
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion poetry/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8bbf311

Please sign in to comment.