cooperspencer / gickup

https://cooperspencer.github.io/gickup-documentation/
Apache License 2.0
962 stars 34 forks source link

fix: use gitlab namespace path instead of owner #99

Closed mtoohey31 closed 2 years ago

mtoohey31 commented 2 years ago

When authenticating with GitLab via SSH, I get the following error:

2022-02-25T18:25:54-05:00 INF grabbing repositories from mtoohey stage=gitlab url=https://gitlab.com
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x8d99da]

goroutine 1 [running]:
gickup/gitlab.Get(0xc0001746e0)
    /home/mtoohey/repos/gickup/gitlab/gitlab.go:145 +0x10fa
main.RunBackup(0xc0001746e0)
    /home/mtoohey/repos/gickup/main.go:148 +0x285
main.main()
    /home/mtoohey/repos/gickup/main.go:234 +0xb15
exit status 2

According to the GitLab API docs, it seems that Namespace.FullPath should always be present, so this PR switches to using that, because Owner.Username doesn't seem to be available over SSH. I've tested this with SSH and token authentication.