mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-27 04:58:17 +00:00
Fix logic for ignoring tag version matching
This commit is contained in:
parent
9475102a4a
commit
fccf69567f
3 changed files with 5 additions and 5 deletions
4
dist/index.js
vendored
4
dist/index.js
vendored
|
|
@ -1248,8 +1248,8 @@ async function run() {
|
|||
|
||||
if (currentTag) {
|
||||
let tagVersion = parseVersion(currentTag);
|
||||
if (tagVersion[0] !== major &&
|
||||
tagVersion[1] !== minor &&
|
||||
if (tagVersion[0] !== major ||
|
||||
tagVersion[1] !== minor ||
|
||||
tagVersion[2] !== patch) {
|
||||
[major, minor, patch] = tagVersion;
|
||||
increment = 0;
|
||||
|
|
|
|||
4
index.js
4
index.js
|
|
@ -227,8 +227,8 @@ async function run() {
|
|||
|
||||
if (currentTag) {
|
||||
let tagVersion = parseVersion(currentTag);
|
||||
if (tagVersion[0] !== major &&
|
||||
tagVersion[1] !== minor &&
|
||||
if (tagVersion[0] !== major ||
|
||||
tagVersion[1] !== minor ||
|
||||
tagVersion[2] !== patch) {
|
||||
[major, minor, patch] = tagVersion;
|
||||
increment = 0;
|
||||
|
|
|
|||
|
|
@ -510,7 +510,7 @@ test('Increment not affected by matching tag', () => {
|
|||
|
||||
repo.makeCommit('Initial Commit'); // 0.0.1+0
|
||||
repo.makeCommit('Second Commit'); // 0.0.1+1
|
||||
repo.exec('git tag 1.0.0');
|
||||
repo.exec('git tag 0.0.1');
|
||||
expect(repo.runAction()).toMatch('Version is 0.0.1+1');
|
||||
|
||||
repo.clean();
|
||||
|
|
|
|||
Loading…
Reference in a new issue