2 Commits

Author SHA1 Message Date
8372dad929 Changelog v0.4.1 (#176)
Changelog v0.4.1

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/176
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Gary Kim <gary@garykim.dev>
2020-09-13 21:48:36 +00:00
edd180a8f5 Fix notification: --all dont relay on a repo (#159)
fix nil pointer exeption

make notifications work outside a repo

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/159
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: mrsdizzie <info@mrsdizzie.com>
2020-07-20 03:09:34 +00:00
3 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,10 @@
# Changelog # Changelog
## [v0.4.1](https://gitea.com/gitea/tea/releases/tag/v0.4.1) - 2020-09-13
* BUGFIXES
* Notification don't relay on a repo (#159)
## [v0.4.0](https://gitea.com/gitea/tea/pulls?q=&type=all&state=closed&milestone=1264) - 2020-07-18 ## [v0.4.0](https://gitea.com/gitea/tea/pulls?q=&type=all&state=closed&milestone=1264) - 2020-07-18
* FEATURES * FEATURES

View File

@ -197,6 +197,9 @@ func curGitRepoPath(path string) (*Login, string, error) {
} else { } else {
repo, err = git.RepoFromPath(path) repo, err = git.RepoFromPath(path)
} }
if err != nil {
return nil, "", err
}
gitConfig, err := repo.Config() gitConfig, err := repo.Config()
if err != nil { if err != nil {
return nil, "", err return nil, "", err

View File

@ -46,9 +46,6 @@ var CmdNotifications = cli.Command{
} }
func runNotifications(ctx *cli.Context) error { func runNotifications(ctx *cli.Context) error {
login, owner, repo := initCommand()
client := login.Client()
var news []*gitea.NotificationThread var news []*gitea.NotificationThread
var err error var err error
@ -58,11 +55,13 @@ func runNotifications(ctx *cli.Context) error {
} }
if ctx.Bool("all") { if ctx.Bool("all") {
news, err = client.ListNotifications(gitea.ListNotificationOptions{ login := initCommandLoginOnly()
news, err = login.Client().ListNotifications(gitea.ListNotificationOptions{
ListOptions: listOpts, ListOptions: listOpts,
}) })
} else { } else {
news, err = client.ListRepoNotifications(owner, repo, gitea.ListNotificationOptions{ login, owner, repo := initCommand()
news, err = login.Client().ListRepoNotifications(owner, repo, gitea.ListNotificationOptions{
ListOptions: listOpts, ListOptions: listOpts,
}) })
} }