Skip to content

index is out of range 0..-1 error when git tags do not have count and hash #27

@rigdent

Description

@rigdent

Hello,

I'm getting the following error on version 3.0.0

Caused by: java.lang.IndexOutOfBoundsException: index is out of range 0..-1 (index = 0)
        at com.cinnober.gradle.semver_git.SemverGitPlugin.getGitVersion(SemverGitPlugin.groovy:48)

on my repo because my git tag looks like

➜  ✗ git describe --tags --dirty --abbrev=7
v1.1.0

So there's no count or hash, so the regex match doesn't yield any results for count and hash.
What's the best course of action? This was on a RHEL 7 box.

Also, parseVersion also fails for v-prefixed versions like above. Is that intentional? Are tags without the v prefix recommended?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions