diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-05 11:57:32 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-07 10:52:51 +1100 |
commit | 05fa483f4818d45b357187700079c3bdae663df2 (patch) | |
tree | fb4fe7d3fda3e8b3e3d862c7a5e1383de456fe60 /pkg/gui/patch_options_panel.go | |
parent | e524e398423f8aea2961302287123085dcc5a524 (diff) |
simplify how we log commands
Diffstat (limited to 'pkg/gui/patch_options_panel.go')
-rw-r--r-- | pkg/gui/patch_options_panel.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go index facaa08db..dd29f9d42 100644 --- a/pkg/gui/patch_options_panel.go +++ b/pkg/gui/patch_options_panel.go @@ -98,7 +98,8 @@ func (gui *Gui) handleDeletePatchFromCommit() error { return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { commitIndex := gui.getPatchCommitIndex() - err := gui.GitCommand.WithSpan(gui.Tr.Spans.RemovePatchFromCommit).DeletePatchesFromCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager) + gui.logSpan(gui.Tr.Spans.RemovePatchFromCommit) + err := gui.GitCommand.DeletePatchesFromCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager) return gui.handleGenericMergeCommandResult(err) }) } @@ -114,7 +115,8 @@ func (gui *Gui) handleMovePatchToSelectedCommit() error { return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { commitIndex := gui.getPatchCommitIndex() - err := gui.GitCommand.WithSpan(gui.Tr.Spans.MovePatchToSelectedCommit).MovePatchToSelectedCommit(gui.State.Commits, commitIndex, gui.State.Panels.Commits.SelectedLineIdx, gui.GitCommand.PatchManager) + gui.logSpan(gui.Tr.Spans.MovePatchToSelectedCommit) + err := gui.GitCommand.MovePatchToSelectedCommit(gui.State.Commits, commitIndex, gui.State.Panels.Commits.SelectedLineIdx, gui.GitCommand.PatchManager) return gui.handleGenericMergeCommandResult(err) }) } @@ -131,7 +133,8 @@ func (gui *Gui) handleMovePatchIntoWorkingTree() error { pull := func(stash bool) error { return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { commitIndex := gui.getPatchCommitIndex() - err := gui.GitCommand.WithSpan(gui.Tr.Spans.MovePatchIntoIndex).MovePatchIntoIndex(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager, stash) + gui.logSpan(gui.Tr.Spans.MovePatchIntoIndex) + err := gui.GitCommand.MovePatchIntoIndex(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager, stash) return gui.handleGenericMergeCommandResult(err) }) } @@ -160,7 +163,8 @@ func (gui *Gui) handlePullPatchIntoNewCommit() error { return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { commitIndex := gui.getPatchCommitIndex() - err := gui.GitCommand.WithSpan(gui.Tr.Spans.MovePatchIntoNewCommit).PullPatchIntoNewCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager) + gui.logSpan(gui.Tr.Spans.MovePatchIntoNewCommit) + err := gui.GitCommand.PullPatchIntoNewCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager) return gui.handleGenericMergeCommandResult(err) }) } @@ -174,7 +178,8 @@ func (gui *Gui) handleApplyPatch(reverse bool) error { if reverse { span = "Apply patch in reverse" } - if err := gui.GitCommand.WithSpan(span).PatchManager.ApplyPatches(reverse); err != nil { + gui.logSpan(span) + if err := gui.GitCommand.PatchManager.ApplyPatches(reverse); err != nil { return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) |