Skip to content

Commit 9b243a3

Browse files
committed
test(bump): fixes logic issue made evident by the latest fix(git) commit
git was failing "fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree". There is no HEAD for get_commits until at least one commit is made.
1 parent d36c0c2 commit 9b243a3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/commands/test_bump_command.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,19 @@ def test_bump_when_version_is_not_specify(mocker):
273273

274274
@pytest.mark.usefixtures("tmp_commitizen_project")
275275
def test_bump_when_no_new_commit(mocker):
276+
"""bump without any commits since the last bump."""
277+
# We need this first commit otherwise the revision is invalid.
278+
create_file_and_commit("feat: initial")
279+
276280
testargs = ["cz", "bump", "--yes"]
277281
mocker.patch.object(sys, "argv", testargs)
278282

283+
# First bump.
284+
# The next bump should fail since
285+
# there is not a commit between the two bumps.
286+
cli.main()
287+
288+
# bump without a new commit.
279289
with pytest.raises(NoCommitsFoundError) as excinfo:
280290
cli.main()
281291

0 commit comments

Comments
 (0)