Skip to content

Commit

Permalink
Merge pull request #17 from ioben/topic/fix-13
Browse files Browse the repository at this point in the history
Support git tags with backslacks
  • Loading branch information
mtkennerly authored Apr 27, 2021
2 parents 22cdbfc + 11d8600 commit 1e929b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dunamai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def from_git(cls, pattern: str = _VERSION_PATTERN, latest_tag: bool = False) ->
dirty = True

code, msg = _run_cmd(
'git for-each-ref "refs/tags/*" --merged HEAD'
'git for-each-ref "refs/tags/**" --merged HEAD'
' --format "%(refname)'
"@{%(objectname)"
"@{%(creatordate:iso-strict)"
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/test_dunamai.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def test__version__from_git__with_annotated_tags(tmp_path) -> None:
assert from_explicit_vcs(Vcs.Git) == Version("0.1.0", commit="abc", dirty=False)
assert run("dunamai from any --bump") == "0.1.1"

# Verify tags with '/' work
run("git tag test/v0.1.0")
assert run(r'dunamai from any --pattern "^test/v(?P<base>\d\.\d\.\d)"') == "0.1.0"

(vcs / "foo.txt").write_text("bye")
assert from_vcs() == Version("0.1.0", commit="abc", dirty=True)

Expand Down

0 comments on commit 1e929b2

Please sign in to comment.