Skip to content

Commit 5c488e9

Browse files
fix: only consider major when commit message starts with major identifier
1 parent 4be4819 commit 5c488e9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spec/git-version-spec.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ describe GitVersion do
474474
tmp.exec %(git checkout -b master)
475475
tmp.exec %(git commit --no-gpg-sign --allow-empty -m "1")
476476
tmp.exec %(git tag "0.1.0")
477-
tmp.exec %(git commit --no-gpg-sign --allow-empty -m ":breaking: 2")
477+
tmp.exec %(git commit --no-gpg-sign --allow-empty -m "breaking: 2")
478478

479479
version = git.get_new_version
480480
version.should eq("1.0.0")
@@ -495,7 +495,7 @@ describe GitVersion do
495495
tmp.exec %(git tag "0.1.0")
496496
tmp.exec %(git commit --no-gpg-sign --allow-empty -m "feature: 2")
497497
tmp.exec %(git tag "0.2.0-asd")
498-
tmp.exec %(git commit --no-gpg-sign --allow-empty -m ":breaking: 2")
498+
tmp.exec %(git commit --no-gpg-sign --allow-empty -m "breaking: 2")
499499

500500
version = git.get_new_version
501501
version.should eq("1.0.0")

src/git-version.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ module GitVersion
153153
get_commits_since(previous_tag).each do |c|
154154
commit = c.downcase
155155
match = if @major_id_is_regex
156-
/#{@major_identifier}/.match(commit)
156+
/^#{@major_identifier}/.match(commit)
157157
else
158-
commit.includes?(@major_identifier)
158+
/^#{@major_identifier}/.match(commit)
159159
end
160160
if match
161161
previous_version =

0 commit comments

Comments
 (0)