diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-10 17:31:23 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-11 17:07:49 +1000 |
commit | 6fbe660f96419e27f13004b2afede5272f9eb9f7 (patch) | |
tree | 43d36ca7536404ee1df8a72ef5e754c8f5dba51d /pkg/gui/remotes_panel.go | |
parent | 74320f00752926b42f0e4d6f84b3816d7a0134a9 (diff) |
full coverage for logging commands
Diffstat (limited to 'pkg/gui/remotes_panel.go')
-rw-r--r-- | pkg/gui/remotes_panel.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/gui/remotes_panel.go b/pkg/gui/remotes_panel.go index 5ba52c2ac..00feb5680 100644 --- a/pkg/gui/remotes_panel.go +++ b/pkg/gui/remotes_panel.go @@ -85,7 +85,7 @@ func (gui *Gui) handleAddRemote() error { return gui.prompt(promptOpts{ title: gui.Tr.LcNewRemoteUrl, handleConfirm: func(remoteUrl string) error { - if err := gui.GitCommand.AddRemote(remoteName, remoteUrl); err != nil { + if err := gui.GitCommand.WithSpan("Add remote").AddRemote(remoteName, remoteUrl); err != nil { return err } return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{REMOTES}}) @@ -106,7 +106,7 @@ func (gui *Gui) handleRemoveRemote() error { title: gui.Tr.LcRemoveRemote, prompt: gui.Tr.LcRemoveRemotePrompt + " '" + remote.Name + "'?", handleConfirm: func() error { - if err := gui.GitCommand.RemoveRemote(remote.Name); err != nil { + if err := gui.GitCommand.WithSpan("Remove remote").RemoveRemote(remote.Name); err != nil { return gui.surfaceError(err) } @@ -128,12 +128,14 @@ func (gui *Gui) handleEditRemote() error { }, ) + gitCommand := gui.GitCommand.WithSpan("Update remote") + return gui.prompt(promptOpts{ title: editNameMessage, initialContent: remote.Name, handleConfirm: func(updatedRemoteName string) error { if updatedRemoteName != remote.Name { - if err := gui.GitCommand.RenameRemote(remote.Name, updatedRemoteName); err != nil { + if err := gitCommand.RenameRemote(remote.Name, updatedRemoteName); err != nil { return gui.surfaceError(err) } } @@ -155,7 +157,7 @@ func (gui *Gui) handleEditRemote() error { title: editUrlMessage, initialContent: url, handleConfirm: func(updatedRemoteUrl string) error { - if err := gui.GitCommand.UpdateRemoteUrl(updatedRemoteName, updatedRemoteUrl); err != nil { + if err := gitCommand.UpdateRemoteUrl(updatedRemoteName, updatedRemoteUrl); err != nil { return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{BRANCHES, REMOTES}}) |