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

Failed to retrieve information when remote starts with 'http' #36

Closed
Dominiquini opened this issue Jan 8, 2022 · 0 comments · Fixed by #43
Closed

Failed to retrieve information when remote starts with 'http' #36

Dominiquini opened this issue Jan 8, 2022 · 0 comments · Fixed by #43
Labels
bug Something isn't working

Comments

@Dominiquini
Copy link

I tried to run this command:

And it failed with this message:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0xc5ad3b]

goroutine 1 [running]:
github.com/go-git/go-git/v5.dotGitToOSFilesystems({0xc00000a480, 0x30}, 0x0)
        github.com/go-git/go-git/v5@v5.4.2/repository.go:283 +0x25b
github.com/go-git/go-git/v5.PlainOpenWithOptions({0xc00000a480, 0x23}, 0xc000107b36)
        github.com/go-git/go-git/v5@v5.4.2/repository.go:241 +0x45
github.com/go-git/go-git/v5.PlainOpen(...)
        github.com/go-git/go-git/v5@v5.4.2/repository.go:235
main.originURL({0xc00000a480, 0xc000107b80})
        github.com/muesli/gitty/git.go:102 +0x35
main.parseRepo({0xc00000a480, 0x23})
        github.com/muesli/gitty/git.go:171 +0x27
main.parseRepository()
        github.com/muesli/gitty/main.go:67 +0x18d
main.main()
        github.com/muesli/gitty/main.go:256 +0x95

If I try to run:

  • gitty github.com/muesli/gitty.git

Then everything goes fine!

gitty version: gitty 0.6.0 (5c5b621)
OS: Windows 10 x64

Thanks

@muesli muesli added the bug Something isn't working label Jan 9, 2022
muesli added a commit to muesli/go-git-1 that referenced this issue Jan 14, 2022
When fs.Stat returns an error, pathinfo may be nil. In such situations
the only safe response seems to be to return the error to the caller.

Without this fix, accessing pathinfo.IsDir() below would lead to a crash
dereferencing a nil pointer.

This crash can be reproduced by trying to initialize a Git repo with an
invalid path name.

Also see: muesli/gitty#36
mcuadros pushed a commit to go-git/go-git that referenced this issue Jan 19, 2022
When fs.Stat returns an error, pathinfo may be nil. In such situations
the only safe response seems to be to return the error to the caller.

Without this fix, accessing pathinfo.IsDir() below would lead to a crash
dereferencing a nil pointer.

This crash can be reproduced by trying to initialize a Git repo with an
invalid path name.

Also see: muesli/gitty#36
muesli added a commit that referenced this issue Feb 1, 2022
@muesli muesli closed this as completed in #43 Feb 1, 2022
muesli added a commit that referenced this issue Feb 1, 2022
gibchikafa pushed a commit to gibchikafa/go-git that referenced this issue Nov 23, 2022
When fs.Stat returns an error, pathinfo may be nil. In such situations
the only safe response seems to be to return the error to the caller.

Without this fix, accessing pathinfo.IsDir() below would lead to a crash
dereferencing a nil pointer.

This crash can be reproduced by trying to initialize a Git repo with an
invalid path name.

Also see: muesli/gitty#36
durandj pushed a commit to durandj/go-git that referenced this issue Jul 1, 2023
When fs.Stat returns an error, pathinfo may be nil. In such situations
the only safe response seems to be to return the error to the caller.

Without this fix, accessing pathinfo.IsDir() below would lead to a crash
dereferencing a nil pointer.

This crash can be reproduced by trying to initialize a Git repo with an
invalid path name.

Also see: muesli/gitty#36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants