Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: runtime error: index out of range [0] with length 0 #17

Open
halkeye opened this issue Mar 11, 2024 · 2 comments
Open

panic: runtime error: index out of range [0] with length 0 #17

halkeye opened this issue Mar 11, 2024 · 2 comments
Assignees

Comments

@halkeye
Copy link

halkeye commented Mar 11, 2024

$ bump minor --allow-dirty
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/guilhem/bump/pkg/semver.Latest({0x0, 0x0, 0x2?})
 /home/halkeye/go/pkg/mod/github.com/guilhem/[email protected]/pkg/semver/semver.go:60 +0x186
github.com/guilhem/bump/cmd.preRun(0xe47760, {0x9def6e?, 0x4?, 0x9def72?})
 /home/halkeye/go/pkg/mod/github.com/guilhem/[email protected]/cmd/root.go:116 +0x29d
github.com/spf13/cobra.(*Command).execute(0xe47760, {0xc000119a30, 0x1, 0x1})
 /home/halkeye/go/pkg/mod/github.com/spf13/[email protected]/command.go:835 +0x5c3
github.com/spf13/cobra.(*Command).ExecuteC(0xe47c60)
 /home/halkeye/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x38d
github.com/spf13/cobra.(*Command).Execute(...)
 /home/halkeye/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
 /home/halkeye/go/pkg/mod/github.com/spf13/[email protected]/command.go:895
github.com/guilhem/bump/cmd.Execute()
 /home/halkeye/go/pkg/mod/github.com/guilhem/[email protected]/cmd/root.go:63 +0x1f8
main.main()
 /home/halkeye/go/pkg/mod/github.com/guilhem/[email protected]/main.go:21 +0xf

I think its having trouble with grabbing tags?

$  bump minor --allow-dirty --latest-tag=false
Use the arrow keys to navigate: ↓ ↑ → ←
? Select Previous tag:

No results

Though there are tags

$  git tag
v0.1.0
v0.2.0
@guilhem
Copy link
Owner

guilhem commented Mar 11, 2024

@halkeye bump should not panic now, but I have to dig more why there is no tags listed by go-git

@halkeye
Copy link
Author

halkeye commented Apr 3, 2024

Yea i'm not sure either, maybe annotated tags?

Either way, tried it again on a different project and its happy

\o/ thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants