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

index out of range #81

Open
axel22 opened this issue Oct 26, 2018 · 3 comments
Open

index out of range #81

axel22 opened this issue Oct 26, 2018 · 3 comments

Comments

@axel22
Copy link

axel22 commented Oct 26, 2018

Scenario - go to a repository with a dirty index but nothing staged:

1. $ grv
2. <g-t> to switch to next tab
3. <Tab> to switch to the diff view (which is empty, unless something is staged).
4. <Enter>

Output:

anic: runtime error: index out of range

                                       goroutine 45 [running]:
                                                              main.selectDiffLine(0xc420174180, 0x1c, 0x0, 0x0, 0x0, 0x0, 0x0)
                                                                                                                              	/home/richard/code/goworkspace/src/github.com/rgburke/grv/cmd/grv/diff_view.go:736 +0x47d
                                                                                                                                                                                                                         main.(*DiffView).HandleAction(0xc420174180, 0x1c, 0x0, 0x0, 0x0, 0x0, 0x0)
                                                                                                                                                                                                                                                                                                   	/home/richard/code/goworkspace/src/github.com/rgburke/grv/cmd/grv/diff_view.go:634 +0x1de
                                                                   main.(*ContainerView).HandleAction(0xc4200bc420, 0x1c, 0x0, 0x0, 0x0, 0x0, 0x0)
                                                                                                                                                  	/home/richard/code/goworkspace/src/github.com/rgburke/grv/cmd/grv/container_view.go:195 +0x11a
                                                                                                                                                                                                                                                      main.(*View).HandleAction(0xc4201900f0, 0x1c, 0x0, 0x0, 0x0, 0x0, 0x0)
                                                                                                                                                                                                                                                                                                                            	/home/richard/code/goworkspace/src/github.com/rgburke/grv/cmd/grv/view.go:527 +0x29f
                                                                                   main.(*GRV).runHandlerLoop(0xc42010fae0, 0xc4201ca040, 0xc42008c7e0, 0xc4200c08a0, 0xc4200c0900, 0xc4200c09c0, 0xc4200c0960)
                                                                                                                                                                                                               	/home/richard/code/goworkspace/src/github.com/rgburke/grv/cmd/grv/grv.go:473 +0x532
                                                                                                                                                                                                                                                                                                   created by main.(*GRV).Run
                                                                                                                                                                                                                                                                                                                             /home/richard/code/goworkspace/src/github.com/rgburke/grv/cmd/grv/grv.go:299 +0x1bc
                                                                                  ⏎ 
@rgburke
Copy link
Owner

rgburke commented Oct 28, 2018

Hi, thanks for reporting this. Could you confirm which version of GRV you're using and on which OS? This issue should be fixed in the latest version of GRV.

@axel22
Copy link
Author

axel22 commented Oct 29, 2018

Version:

GRV - Git Repository Viewer v0.3.0-0-g5589a31 (compiled with go1.10.4 at 2018-09-29 11:55:05 BST)

OS is Ubuntu 18.04:

4.15.0-36-generic #39-Ubuntu ... x86_64 x86_64 x86_64 GNU/Linux

@axel22
Copy link
Author

axel22 commented Oct 29, 2018

Btw, I also noticed that when I look at the changes in a repo with changes, the first changed file is always reported as having not changes, when in fact it does.

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