diff options
Diffstat (limited to 'pkg')
37 files changed, 207 insertions, 207 deletions
diff --git a/pkg/app/app.go b/pkg/app/app.go index 99218b0c8..ad3246ace 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -184,7 +184,7 @@ func (app *App) setupRepo() (bool, error) { } if env.GetGitDirEnv() != "" { - // we've been given the git dir directly. We'll verify this dir when initializing our GitCommand object + // we've been given the git dir directly. We'll verify this dir when initializing our Git object return false, nil } diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 5e0958727..880233dc9 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -31,7 +31,7 @@ func (gui *Gui) branchesRenderToMain() error { if branch == nil { task = NewRenderStringTask(gui.Tr.NoBranchesThisRepo) } else { - cmdObj := gui.GitCommand.Branch.GetGraphCmdObj(branch.Name) + cmdObj := gui.Git.Branch.GetGraphCmdObj(branch.Name) task = NewRunPtyTask(cmdObj.GetCmd()) } @@ -54,13 +54,13 @@ func (gui *Gui) refreshBranches() { // which allows us to order them correctly. So if we're filtering we'll just // manually load all the reflog commits here var err error - reflogCommits, _, err = gui.GitCommand.Loaders.ReflogCommits.GetReflogCommits(nil, "") + reflogCommits, _, err = gui.Git.Loaders.ReflogCommits.GetReflogCommits(nil, "") if err != nil { gui.Log.Error(err) } } - gui.State.Branches = gui.GitCommand.Loaders.Branches.Load(reflogCommits) + gui.State.Branches = gui.Git.Loaders.Branches.Load(reflogCommits) if err := gui.postRefreshUpdate(gui.State.Contexts.Branches); err != nil { gui.Log.Error(err) @@ -103,7 +103,7 @@ func (gui *Gui) handleCopyPullRequestURLPress() error { branch := gui.getSelectedBranch() - branchExistsOnRemote := gui.GitCommand.Remote.CheckRemoteBranchExists(branch.Name) + branchExistsOnRemote := gui.Git.Remote.CheckRemoteBranchExists(branch.Name) if !branchExistsOnRemote { return gui.surfaceError(errors.New(gui.Tr.NoBranchOnRemote)) @@ -146,7 +146,7 @@ func (gui *Gui) handleForceCheckout() error { prompt: message, handleConfirm: func() error { gui.logAction(gui.Tr.Actions.ForceCheckoutBranch) - if err := gui.GitCommand.Branch.Checkout(branch.Name, git_commands.CheckoutOptions{Force: true}); err != nil { + if err := gui.Git.Branch.Checkout(branch.Name, git_commands.CheckoutOptions{Force: true}); err != nil { _ = gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) @@ -176,7 +176,7 @@ func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions) } return gui.WithWaitingStatus(waitingStatus, func() error { - if err := gui.GitCommand.Branch.Checkout(ref, cmdOptions); err != nil { + if err := gui.Git.Branch.Checkout(ref, cmdOptions); err != nil { // note, this will only work for english-language git commands. If we force git to use english, and the error isn't this one, then the user will receive an english command they may not understand. I'm not sure what the best solution to this is. Running the command once in english and a second time in the native language is one option if options.onRefNotFound != nil && strings.Contains(err.Error(), "did not match any file(s) known to git") { @@ -190,15 +190,15 @@ func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions) title: gui.Tr.AutoStashTitle, prompt: gui.Tr.AutoStashPrompt, handleConfirm: func() error { - if err := gui.GitCommand.Stash.Save(gui.Tr.StashPrefix + ref); err != nil { + if err := gui.Git.Stash.Save(gui.Tr.StashPrefix + ref); err != nil { return gui.surfaceError(err) } - if err := gui.GitCommand.Branch.Checkout(ref, cmdOptions); err != nil { + if err := gui.Git.Branch.Checkout(ref, cmdOptions); err != nil { return gui.surfaceError(err) } onSuccess() - if err := gui.GitCommand.Stash.Pop(0); err != nil { + if err := gui.Git.Stash.Pop(0); err != nil { if err := gui.refreshSidePanels(refreshOptions{mode: BLOCK_UI}); err != nil { return err } @@ -254,7 +254,7 @@ func (gui *Gui) createNewBranchWithName(newBranchName string) error { return nil } - if err := gui.GitCommand.Branch.New(newBranchName, branch.Name); err != nil { + if err := gui.Git.Branch.New(newBranchName, branch.Name); err != nil { return gui.surfaceError(err) } @@ -298,7 +298,7 @@ func (gui *Gui) deleteNamedBranch(selectedBranch *models.Branch, force bool) err prompt: message, handleConfirm: func() error { gui.logAction(gui.Tr.Actions.DeleteBranch) - if err := gui.GitCommand.Branch.Delete(selectedBranch.Name, force); err != nil { + if err := gui.Git.Branch.Delete(selectedBranch.Name, force); err != nil { errMessage := err.Error() if !force && strings.Contains(errMessage, "git branch -D ") { return gui.deleteNamedBranch(selectedBranch, true) @@ -315,7 +315,7 @@ func (gui *Gui) mergeBranchIntoCheckedOutBranch(branchName string) error { return err } - if gui.GitCommand.Branch.IsHeadDetached() { + if gui.Git.Branch.IsHeadDetached() { return gui.createErrorPanel("Cannot merge branch in detached head state. You might have checked out a commit directly or a remote branch, in which case you should checkout the local branch you want to be on") } checkedOutBranchName := gui.getCheckedOutBranch().Name @@ -335,7 +335,7 @@ func (gui *Gui) mergeBranchIntoCheckedOutBranch(branchName string) error { prompt: prompt, handleConfirm: func() error { gui.logAction(gui.Tr.Actions.Merge) - err := gui.GitCommand.Branch.Merge(branchName, git_commands.MergeOpts{}) + err := gui.Git.Branch.Merge(branchName, git_commands.MergeOpts{}) return gui.handleGenericMergeCommandResult(err) }, }) @@ -377,7 +377,7 @@ func (gui *Gui) handleRebaseOntoBranch(selectedBranchName string) error { prompt: prompt, handleConfirm: func() error { gui.logAction(gui.Tr.Actions.RebaseBranch) - err := gui.GitCommand.Rebase.RebaseBranch(selectedBranchName) + err := gui.Git.Rebase.RebaseBranch(selectedBranchName) return gui.handleGenericMergeCommandResult(err) }, }) @@ -396,7 +396,7 @@ func (gui *Gui) handleFastForward() error { return gui.createErrorPanel(gui.Tr.FwdCommitsToPush) } - upstream, err := gui.GitCommand.Branch.GetUpstream(branch.Name) + upstream, err := gui.Git.Branch.GetUpstream(branch.Name) if err != nil { return gui.surfaceError(err) } @@ -421,7 +421,7 @@ func (gui *Gui) handleFastForward() error { _ = gui.pullWithLock(PullFilesOptions{action: action, FastForwardOnly: true}) } else { gui.logAction(action) - err := gui.GitCommand.Sync.FastForward(branch.Name, remoteName, remoteBranchName) + err := gui.Git.Sync.FastForward(branch.Name, remoteName, remoteBranchName) gui.handleCredentialsPopup(err) _ = gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []RefreshableView{BRANCHES}}) } @@ -450,7 +450,7 @@ func (gui *Gui) handleRenameBranch() error { initialContent: branch.Name, handleConfirm: func(newBranchName string) error { gui.logAction(gui.Tr.Actions.RenameBranch) - if err := gui.GitCommand.Branch.Rename(branch.Name, newBranchName); err != nil { + if err := gui.Git.Branch.Rename(branch.Name, newBranchName); err != nil { return gui.surfaceError(err) } @@ -519,7 +519,7 @@ func (gui *Gui) handleNewBranchOffCurrentItem() error { initialContent: prefilledName, handleConfirm: func(response string) error { gui.logAction(gui.Tr.Actions.CreateBranch) - if err := gui.GitCommand.Branch.New(sanitizedBranchName(response), item.ID()); err != nil { + if err := gui.Git.Branch.New(sanitizedBranchName(response), item.ID()); err != nil { return err } diff --git a/pkg/gui/cherry_picking.go b/pkg/gui/cherry_picking.go index 3f49d3534..b4b9439cd 100644 --- a/pkg/gui/cherry_picking.go +++ b/pkg/gui/cherry_picking.go @@ -149,7 +149,7 @@ func (gui *Gui) HandlePasteCommits() error { handleConfirm: func() error { return gui.WithWaitingStatus(gui.Tr.CherryPickingStatus, func() error { gui.logAction(gui.Tr.Actions.CherryPick) - err := gui.GitCommand.Rebase.CherryPickCommits(gui.State.Modes.CherryPicking.CherryPickedCommits) + err := gui.Git.Rebase.CherryPickCommits(gui.State.Modes.CherryPicking.CherryPickedCommits) return gui.handleGenericMergeCommandResult(err) }) }, diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go index dab087fc1..e28c5bd7b 100644 --- a/pkg/gui/commit_files_panel.go +++ b/pkg/gui/commit_files_panel.go @@ -45,7 +45,7 @@ func (gui *Gui) commitFilesRenderToMain() error { to := gui.State.CommitFileManager.GetParent() from, reverse := gui.getFromAndReverseArgsForDiff(to) - cmdObj := gui.GitCommand.WorkingTree.ShowFileDiffCmdObj(from, to, reverse, node.GetPath(), false) + cmdObj := gui.Git.WorkingTree.ShowFileDiffCmdObj(from, to, reverse, node.GetPath(), false) task := NewRunPtyTask(cmdObj.GetCmd()) return gui.refreshMainViews(refreshMainOpts{ @@ -64,7 +64,7 @@ func (gui *Gui) handleCheckoutCommitFile() error { } gui.logAction(gui.Tr.Actions.CheckoutFile) - if err := gui.GitCommand.WorkingTree.CheckoutFile(gui.State.CommitFileManager.GetParent(), node.GetPath()); err != nil { + if err := gui.Git.WorkingTree.CheckoutFile(gui.State.CommitFileManager.GetParent(), node.GetPath()); err != nil { return gui.surfaceError(err) } @@ -84,7 +84,7 @@ func (gui *Gui) handleDiscardOldFileChange() error { handleConfirm: func() error { return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { gui.logAction(gui.Tr.Actions.DiscardOldFileChange) - if err := gui.GitCommand.Rebase.DiscardOldFileChanges(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, fileName); err != nil { + if err := gui.Git.Rebase.DiscardOldFileChanges(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, fileName); err != nil { if err := gui.handleGenericMergeCommandResult(err); err != nil { return err } @@ -107,7 +107,7 @@ func (gui *Gui) refreshCommitFilesView() error { to := gui.State.Panels.CommitFiles.refName from, reverse := gui.getFromAndReverseArgsForDiff(to) - files, err := gui.GitCommand.Loaders.CommitFiles.GetFilesInDiff(from, to, reverse) + files, err := gui.Git.Loaders.CommitFiles.GetFilesInDiff(from, to, reverse) if err != nil { return gui.surfaceError(err) } @@ -145,7 +145,7 @@ func (gui *Gui) handleToggleFileForPatch() error { } toggleTheFile := func() error { - if !gui.GitCommand.Patch.PatchManager.Active() { + if !gui.Git.Patch.PatchManager.Active() { if err := gui.startPatchManager(); err != nil { return err } @@ -154,14 +154,14 @@ func (gui *Gui) handleToggleFileForPatch() error { // if there is any file that hasn't been fully added we'll fully add everything, // otherwise we'll remove everything adding := node.AnyFile(func(file *models.CommitFile) bool { - return gui.GitCommand.Patch.PatchManager.GetFileStatus(file.Name, gui.State.CommitFileManager.GetParent()) != patch.WHOLE + return gui.Git.Patch.PatchManager.GetFileStatus(file.Name, gui.State.CommitFileManager.GetParent()) != patch.WHOLE }) err := node.ForEachFile(func(file *models.CommitFile) error { if adding { - return gui.GitCommand.Patch.PatchManager.AddFileWhole(file.Name) + return gui.Git.Patch.PatchManager.AddFileWhole(file.Name) } else { - return gui.GitCommand.Patch.PatchManager.RemoveFile(file.Name) + return gui.Git.Patch.PatchManager.RemoveFile(file.Name) } }) @@ -169,19 +169,19 @@ func (gui *Gui) handleToggleFileForPatch() error { return gui.surfaceError(err) } - if gui.GitCommand.Patch.PatchManager.IsEmpty() { - gui.GitCommand.Patch.PatchManager.Reset() + if gui.Git.Patch.PatchManager.IsEmpty() { + gui.Git.Patch.PatchManager.Reset() } return gui.postRefreshUpdate(gui.State.Contexts.CommitFiles) } - if gui.GitCommand.Patch.PatchManager.Active() && gui.GitCommand.Patch.PatchManager.To != gui.State.CommitFileManager.GetParent() { + if gui.Git.Patch.PatchManager.Active() && gui.Git.Patch.PatchManager.To != gui.State.CommitFileManager.GetParent() { return gui.ask(askOpts{ title: gui.Tr.DiscardPatch, prompt: gui.Tr.DiscardPatchConfirm, handleConfirm: func() error { - gui.GitCommand.Patch.PatchManager.Reset() + gui.Git.Patch.PatchManager.Reset() return toggleTheFile() }, }) @@ -196,7 +196,7 @@ func (gui *Gui) startPatchManager() error { to := gui.State.Panels.CommitFiles.refName from, reverse := gui.getFromAndReverseArgsForDiff(to) - gui.GitCommand.Patch.PatchManager.Start(from, to, reverse, canRebase) + gui.Git.Patch.PatchManager.Start(from, to, reverse, canRebase) return nil } @@ -215,7 +215,7 @@ func (gui *Gui) enterCommitFile(opts OnFocusOpts) error { } enterTheFile := func() error { - if !gui.GitCommand.Patch.PatchManager.Active() { + if !gui.Git.Patch.PatchManager.Active() { if err := gui.startPatchManager(); err != nil { return err } @@ -224,13 +224,13 @@ func (gui *Gui) enterCommitFile(opts OnFocusOpts) error { return gui.pushContext(gui.State.Contexts.PatchBuilding, opts) } - if gui.GitCommand.Patch.PatchManager.Active() && gui.GitCommand.Patch.PatchManager.To != gui.State.CommitFileManager.GetParent() { + if gui.Git.Patch.PatchManager.Active() && gui.Git.Patch.PatchManager.To != gui.State.CommitFileManager.GetParent() { return gui.ask(askOpts{ title: gui.Tr.DiscardPatch, prompt: gui.Tr.DiscardPatchConfirm, handlersManageFocus: true, handleConfirm: func() error { - gui.GitCommand.Patch.PatchManager.Reset() + gui.Git.Patch.PatchManager.Reset() return enterTheFile() }, handleClose: func() error { diff --git a/pkg/gui/commit_message_panel.go b/pkg/gui/commit_message_panel.go index 962189d5a..292e37a68 100644 --- a/pkg/gui/commit_message_panel.go +++ b/pkg/gui/commit_message_panel.go @@ -15,7 +15,7 @@ func (gui *Gui) handleCommitConfirm() error { return gui.createErrorPanel(gui.Tr.CommitWithoutMessageErr) } - cmdObj := gui.GitCommand.Commit.CommitCmdObj(message) + cmdObj := gui.Git.Commit.CommitCmdObj(message) gui.logAction(gui.Tr.Actions.Commit) _ = gui.returnFromContext() diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index bbe3ada05..3817e9e47 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -45,7 +45,7 @@ func (gui *Gui) branchCommitsRenderToMain() error { if commit == nil { task = NewRenderStringTask(gui.Tr.NoCommitsThisBranch) } else { - cmdObj := gui.GitCommand.Commit.ShowCmdObj(commit.Sha, gui.State.Modes.Filtering.GetPath()) + cmdObj := gui.Git.Commit.ShowCmdObj(commit.Sha, gui.State.Modes.Filtering.GetPath()) task = NewRunPtyTask(cmdObj.GetCmd()) } @@ -118,7 +118,7 @@ func (gui *Gui) refreshCommitsWithLimit() error { gui.Mutexes.BranchCommitsMutex.Lock() defer gui.Mutexes.BranchCommitsMutex.Unlock() - commits, err := gui.GitCommand.Loaders.Commits.GetCommits( + commits, err := gui.Git.Loaders.Commits.GetCommits( loaders.GetCommitsOptions{ Limit: gui.State.Panels.Commits.LimitCommits, FilterPath: gui.State.Modes.Filtering.GetPath(), @@ -139,7 +139,7 @@ func (gui *Gui) refreshRebaseCommits() error { gui.Mutexes.BranchCommitsMutex.Lock() defer gui.Mutexes.BranchCommitsMutex.Unlock() - updatedCommits, err := gui.GitCommand.Loaders.Commits.MergeRebasingCommits(gui.State.Commits) + updatedCommits, err := gui.Git.Loaders.Commits.MergeRebasingCommits(gui.State.Commits) if err != nil { return err } @@ -173,7 +173,7 @@ func (gui *Gui) handleCommitSquashDown() error { handleConfirm: func() error { return gui.WithWaitingStatus(gui.Tr.SquashingStatus, func() error { gui.logAction(gui.Tr.Actions.SquashCommitDown) - err := gui.GitCommand.Rebase.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "squash") + err := gui.Git.Rebase.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "squash") return gui.handleGenericMergeCommandResult(err) }) }, @@ -203,7 +203,7 @@ func (gui *Gui) handleCommitFixup() error { handleConfirm: func() error { return gui.WithWaitingStatus(gui.Tr.FixingStatus, func() error { gui.logAction(gui.Tr.Actions.FixupCommit) - err := gui.GitCommand.Rebase.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "fixup") + err := gui.Git.Rebase.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "fixup") return gui.handleGenericMergeCommandResult(err) }) }, @@ -232,7 +232,7 @@ func (gui *Gui) handleRewordCommit() error { return nil } - message, err := gui.GitCommand.Commit.GetCommitMessage(commit.Sha) + message, err := gui.Git.Commit.GetCommitMessage(commit.Sha) if err != nil { return gui.surfaceError(err) } @@ -242,7 +242,7 @@ func (gui *Gui) handleRewordCommit() error { initialContent: message, handleConfirm: func(response string) error { gui.logAction(gui.Tr.Actions.RewordCommit) - if err := gui.GitCommand.Commit.RewordLastCommit(response); err != nil { + if err := gui.Git.Commit.RewordLastCommit(response); err != nil { return gui.surfaceError(err) } @@ -265,7 +265,7 @@ func (gui *Gui) handleRenameCommitEditor() error { } gui.logAction(gui.Tr.Actions.RewordCommit) - subProcess, err := gui.GitCommand.Rebase.RewordCommit(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx) + subProcess, err := gui.Git.Rebase.RewordCommit(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx) if err != nil { return gui.surfaceError(err) } @@ -299,7 +299,7 @@ func (gui *Gui) handleMidRebaseCommand(action string) (bool, error) { false, ) - if err := gui.GitCommand.Rebase.EditRebaseTodo(gui.State.Panels.Commits.SelectedLineIdx, action); err != nil { + if err := gui.Git.Rebase.EditRebaseTodo(gui.State.Panels.Commits.SelectedLineIdx, action); err != nil { return false, gui.surfaceError(err) } @@ -325,7 +325,7 @@ func (gui *Gui) handleCommitDelete() error { handleConfirm: func() error { return gui.WithWaitingStatus(gui.Tr.DeletingStatus, func() error { gui.logAction(gui.Tr.Actions.DropCommit) - err := gui.GitCommand.Rebase.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "drop") + err := gui.Git.Rebase.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "drop") return gui.handleGenericMergeCommandResult(err) }) }, @@ -349,7 +349,7 @@ func (gui *Gui) handleCommitMoveDown() error { gui.logAction(gui.Tr.Actions.MoveCommitDown) gui.logCommand(fmt.Sprintf("Moving commit %s down", selectedCommit.ShortSha()), false) - if err := gui.GitCommand.Rebase.MoveTodoDown(index); err != nil { + if err := gui.Git.Rebase.MoveTodoDown(index); err != nil { return gui.surfaceError(err) } gui.State.Panels.Commits.SelectedLineIdx++ @@ -358,7 +358,7 @@ func (gui *Gui) handleCommitMoveDown() error { return gui.WithWaitingStatus(gui.Tr.MovingStatus, func() error { gui.logAction(gui.Tr.Actions.MoveCommitDown) - err := gui.GitCommand.Rebase.MoveCommitDown(gui.State.Commits, index) + err := gui.Git.Rebase.MoveCommitDown(gui.State.Commits, index) if err == nil { gui.State.Panels.Commits.SelectedLineIdx++ } @@ -386,7 +386,7 @@ func (gui *Gui) handleCommitMoveUp() error { false, ) - if err := gui.GitCommand.Rebase.MoveTodoDown(index - 1); err != nil { + if err := gui.Git.Rebase.MoveTodoDown(index - 1); err != nil { return gui.surfaceError(err) } gui.State.Panels.Commits.SelectedLineIdx-- @@ -395,7 +395,7 @@ func (gui *Gui) handleCommitMoveUp() error { return gui.WithWaitingStatus(gui.Tr.MovingStatus, func() error { gui.logAction(gui.Tr.Actions.MoveCommitUp) - err := gui.GitCommand.Rebase.MoveCommitDown(gui.State.Commits, index-1) + err := gui.Git.Rebase.MoveCommitDown(gui.State.Commits, index-1) if err == nil { gui.State.Panels.Commits.SelectedLineIdx-- } @@ -418,7 +418,7 @@ func (gui *Gui) handleCommitEdit() error { return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { gui.logAction(gui.Tr.Actions.EditCommit) - err = gui.GitCommand.Rebase.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "edit") + err = gui.Git.Rebase.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "edit") return gui.handleGenericMergeCommandResult(err) }) } @@ -434,7 +434,7 @@ func (gui *Gui) handleCommitAmendTo() error { handleConfirm: func() error { return gui.WithWaitingStatus(gui.Tr.AmendingStatus, func() error { gui.logAction(gui.Tr.Actions.AmendCommit) - err := gui.GitCommand.Rebase.AmendTo(gui.State.Commits[gui.State.Panels.Commits.SelectedLineIdx].Sha) + err := gui.Git.Rebase.AmendTo(gui.State.Commits[gui.State.Panels.Commits.SelectedLineIdx].Sha) return gui.handleGenericMergeCommandResult(err) }) }, @@ -470,7 +470,7 @@ func (gui *Gui) handleCommitRevert() error { return gui.createRevertMergeCommitMenu(commit) } else { gui.logAction(gui.Tr.Actions.RevertCommit) - if err := gui.GitCommand.Commit.Revert(commit.Sha); err != nil { + if err := gui.Git.Commit.Revert(commit.Sha); err != nil { return gui.surfaceError(err) } return gui.afterRevertCommit() @@ -481,7 +481,7 @@ func (gui *Gui) createRevertMergeCommitMenu(commit *models.Commit) error { menuItems := make([]*menuItem, len(commit.Parents)) for i, parentSha := range commit.Parents { i := i - message, err := gui.GitCommand.Commit.GetCommitMessageFirstLine(parentSha) + message, err := gui.Git.Commit.GetCommitMessageFirstLine(parentSha) if err != nil { return gui.surfaceError(err) } @@ -491,7 +491,7 @@ func (gui *Gui) createRevertMergeCommitMenu(commit *models.Commit) error { onPress: func() error { parentNumber := i + 1 gui.logAction(gui.Tr.Actions.RevertCommit) - if err := gui.GitCommand.Commit.RevertMerge(commit.Sha, parentNumber); err != nil { + if err := gui.Git.Commit.RevertMerge(commit.Sha, parentNumber); err != nil { return gui.surfaceError(err) } return gui.afterRevertCommit() @@ -538,7 +538,7 @@ func (gui *Gui) handleCreateFixupCommit() error { prompt: prompt, handleConfirm: func() error { gui.logAction(gui.Tr.Actions.CreateFixupCommit) - if err := gui.GitCommand.Commit.CreateFixupCommit(commit.Sha); err != nil { + if err := gui.Git.Commit.CreateFixupCommit(commit.Sha); err != nil { return gui.surfaceError(err) } @@ -570,7 +570,7 @@ func (gui *Gui) handleSquashAllAboveFixupCommits() error { handleConfirm: func() error { return gui.WithWaitingStatus(gui.Tr.SquashingStatus, func() error { gui.logAction(gui.Tr.Actions.SquashAllAboveFixupCommits) - err := gui.GitCommand.Rebase.SquashAllAboveFixupCommits(commit.Sha) + err := gui.Git.Rebase.SquashAllAboveFixupCommits(commit.Sha) return gui.handleGenericMergeCommandResult(err) }) }, @@ -618,7 +618,7 @@ func (gui *Gui) handleCreateAnnotatedTag(commitSha string) error { title: gui.Tr.TagMessageTitle, handleConfirm: func(msg string) error { gui.logAction(gui.Tr.Actions.CreateAnnotatedTag) - if err := gui.GitCommand.Tag.CreateAnnotated(tagName, commitSha, msg); err != nil { + if err := gui.Git.Tag.CreateAnnotated(tagName, commitSha, msg); err != nil { return gui.surfaceError(err) } return gui.afterTagCreate(tagName) @@ -633,7 +633,7 @@ func (gui *Gui) handleCreateLightweightTag(commitSha string) error { title: gui.Tr.TagNameTitle, handleConfirm: func(tagName string) error { gui.logAction(gui.Tr.Actions.CreateLightweightTag) - if err := gui.GitCommand.Tag.CreateLightweight(tagName, commitSha); err != nil { + if err := gui.Git.Tag.CreateLightweight(tagName, commitSha); err != nil { return gui.surfaceError(err) } return gui.afterTagCreate(tagName) @@ -702,7 +702,7 @@ func (gui *Gui) handleCopySelectedCommitMessageToClipboard() error { return nil } - message, err := gui.GitCommand.Commit.GetCommitMessage(commit.Sha) + message, err := gui.Git.Commit.GetCommitMessage(commit.Sha) if err != nil { return gui.surfaceError(err) } diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go index e7a7cbad1..7d8cdd281 100644 --- a/pkg/gui/custom_commands.go +++ b/pkg/gui/custom_commands.go @@ -203,7 +20 |