summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-07-24 16:36:11 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-07-30 18:35:23 +1000
commita313b1670496e1e73745b5a6a922432fb81ce0e6 (patch)
tree800cf236aec51172d8cb3badb61f5385b5f3bcab /pkg/gui
parentb93b9dae888683bb36da141981842a85e8010ff2 (diff)
Add more worktree tests
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/controllers/branches_controller.go5
-rw-r--r--pkg/gui/services/custom_commands/session_state_loader.go2
2 files changed, 6 insertions, 1 deletions
diff --git a/pkg/gui/controllers/branches_controller.go b/pkg/gui/controllers/branches_controller.go
index 4ea8099b2..623514638 100644
--- a/pkg/gui/controllers/branches_controller.go
+++ b/pkg/gui/controllers/branches_controller.go
@@ -475,7 +475,10 @@ func (self *BranchesController) rename(branch *models.Branch) error {
}
// need to find where the branch is now so that we can re-select it. That means we need to refetch the branches synchronously and then find our branch
- _ = self.c.Refresh(types.RefreshOptions{Mode: types.SYNC, Scope: []types.RefreshableView{types.BRANCHES}})
+ _ = self.c.Refresh(types.RefreshOptions{
+ Mode: types.SYNC,
+ Scope: []types.RefreshableView{types.BRANCHES, types.WORKTREES},
+ })
// now that we've got our stuff again we need to find that branch and reselect it.
for i, newBranch := range self.c.Model().Branches {
diff --git a/pkg/gui/services/custom_commands/session_state_loader.go b/pkg/gui/services/custom_commands/session_state_loader.go
index 3566841b7..d5d34bfc9 100644
--- a/pkg/gui/services/custom_commands/session_state_loader.go
+++ b/pkg/gui/services/custom_commands/session_state_loader.go
@@ -33,6 +33,7 @@ type SessionState struct {
SelectedStashEntry *models.StashEntry
SelectedCommitFile *models.CommitFile
SelectedCommitFilePath string
+ SelectedWorktree *models.Worktree
CheckedOutBranch *models.Branch
}
@@ -50,6 +51,7 @@ func (self *SessionStateLoader) call() *SessionState {
SelectedCommitFile: self.c.Contexts().CommitFiles.GetSelectedFile(),
SelectedCommitFilePath: self.c.Contexts().CommitFiles.GetSelectedPath(),
SelectedSubCommit: self.c.Contexts().SubCommits.GetSelected(),
+ SelectedWorktree: self.c.Contexts().Worktrees.GetSelected(),
CheckedOutBranch: self.refsHelper.GetCheckedOutRef(),
}
}