Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

panic in object.getFileStatsFromFilePatches() for commits updating submodules: both from and to are nil #654

Closed
@krylovsk

Description

@krylovsk

Got this error on some private repository with submodules for commits that only update submodules refs: both from and to files are nil here https://github.com/src-d/go-git/blob/master/plumbing/object/patch.go#L278

Here is the panic stacktrace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x110fe8e]

goroutine 1 [running]:
gopkg.in/src-d/go-git.v4/plumbing/object.getFileStatsFromFilePatches(0xc4203b8a00, 0x1, 0x1, 0xc42032b830, 0x0, 0x0)
	/Users/krylovsk/src/gopkg.in/src-d/go-git.v4/plumbing/object/patch.go:278 +0x43e
gopkg.in/src-d/go-git.v4/plumbing/object.(*Patch).Stats(0xc42032b830, 0x0, 0x1, 0xc42032b830)
	/Users/krylovsk/src/gopkg.in/src-d/go-git.v4/plumbing/object/patch.go:111 +0x41
main.main()
	/tmp/git-test/main.go:38 +0x35a
exit status 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions