isacikgoz / gitbatch

manage your git repositories in one place
MIT License
1.54k stars 53 forks source link

Error on startup #43

Closed dAnjou closed 5 years ago

dAnjou commented 5 years ago

Using version 0.2.0

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

goroutine 40 [running]:
github.com/isacikgoz/gitbatch/pkg/git.(*RepoEntity).loadComponents(0xc00021a100, 0x1, 0xc00021a100, 0x0)
    /Users/ibrahim/go/src/github.com/isacikgoz/gitbatch/pkg/git/repository.go:134 +0xfc
github.com/isacikgoz/gitbatch/pkg/git.InitializeRepo(0xc0000afa20, 0x20, 0xc0000a3d20, 0x0, 0x0)
    /Users/ibrahim/go/src/github.com/isacikgoz/gitbatch/pkg/git/repository.go:104 +0x7d
github.com/isacikgoz/gitbatch/pkg/git.LoadRepositoryEntities.func1(0xc0000a3d20, 0xc0000a3d18, 0xc0001ae040, 0xc0000afa20, 0x20)
    /Users/ibrahim/go/src/github.com/isacikgoz/gitbatch/pkg/git/util-load.go:27 +0x7d
created by github.com/isacikgoz/gitbatch/pkg/git.LoadRepositoryEntities
    /Users/ibrahim/go/src/github.com/isacikgoz/gitbatch/pkg/git/util-load.go:23 +0x158
isacikgoz commented 5 years ago

Hey, thanks for submitting the issue. It returns an error while trying sync your active branch with remote branch.

And I guess in repository.go:134 line, can't get name of your active branch on the repository.

    e.Remote.SyncBranches(e.Branch.Name)

so, can you give me more detail about that repository? I think, in branch.go:66 the headref and branch list does not match somehow.

    if b.Name() == headRef.Name() {
        e.Branch = branch
    }
isacikgoz commented 5 years ago

gotcha! I think the repository is not on a ref. It's on a commit or something, I'm investigating.

isacikgoz commented 5 years ago

fixed it with the pr #44 , please let me know if you have still issues. Thanks for the feedback