diff --git a/cmd/config.go b/cmd/config.go index 89255e3..ca5517c 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -197,6 +197,9 @@ func curGitRepoPath(path string) (*Login, string, error) { } else { repo, err = git.RepoFromPath(path) } + if err != nil { + return nil, "", err + } gitConfig, err := repo.Config() if err != nil { return nil, "", err diff --git a/cmd/notifications.go b/cmd/notifications.go index 16ba479..cb4e002 100644 --- a/cmd/notifications.go +++ b/cmd/notifications.go @@ -46,9 +46,6 @@ var CmdNotifications = cli.Command{ } func runNotifications(ctx *cli.Context) error { - login, owner, repo := initCommand() - - client := login.Client() var news []*gitea.NotificationThread var err error @@ -58,11 +55,13 @@ func runNotifications(ctx *cli.Context) error { } if ctx.Bool("all") { - news, err = client.ListNotifications(gitea.ListNotificationOptions{ + login := initCommandLoginOnly() + news, err = login.Client().ListNotifications(gitea.ListNotificationOptions{ ListOptions: listOpts, }) } else { - news, err = client.ListRepoNotifications(owner, repo, gitea.ListNotificationOptions{ + login, owner, repo := initCommand() + news, err = login.Client().ListRepoNotifications(owner, repo, gitea.ListNotificationOptions{ ListOptions: listOpts, }) }