Skip to content

Commit

Permalink
Merge pull request #176 from mtt0/master
Browse files Browse the repository at this point in the history
Fix constraints check with *-0
  • Loading branch information
mattfarina committed Aug 9, 2022
2 parents 3248ef7 + 9f3b646 commit 1959065
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion constraints.go
Expand Up @@ -233,7 +233,7 @@ func parseConstraint(c string) (*constraint, error) {
patchDirty := false
dirty := false
if isX(m[3]) || m[3] == "" {
ver = "0.0.0"
ver = fmt.Sprintf("0.0.0%s", m[6])
dirty = true
} else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" {
minorDirty = true
Expand Down
1 change: 1 addition & 0 deletions constraints_test.go
Expand Up @@ -121,6 +121,7 @@ func TestConstraintCheck(t *testing.T) {
{"*", "1", true},
{"*", "4.5.6", true},
{"*", "1.2.3-alpha.1", false},
{"*-0", "1.2.3-alpha.1", true},
{"2.*", "1", false},
{"2.*", "3.4.5", false},
{"2.*", "2.1.1", true},
Expand Down

0 comments on commit 1959065

Please sign in to comment.