1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-13 11:50:28 +02:00

Refresh BRANCHES and COMMITS after (un)staging upstream

This commit is contained in:
Luka Markušić 2022-04-13 15:46:12 +02:00
parent c4b958e3fd
commit e114b5b5e8

View File

@ -116,6 +116,15 @@ func (self *BranchesController) setUpstream(selectedBranch *models.Branch) error
if err := self.git.Branch.UnsetUpstream(selectedBranch.Name); err != nil {
return self.c.Error(err)
}
if err := self.c.Refresh(types.RefreshOptions{
Mode: types.SYNC,
Scope: []types.RefreshableView{
types.BRANCHES,
types.COMMITS,
},
}); err != nil {
return self.c.Error(err)
}
return nil
},
Key: 'u',
@ -132,6 +141,15 @@ func (self *BranchesController) setUpstream(selectedBranch *models.Branch) error
if err := self.git.Branch.SetUpstream(upstreamRemote, upstreamBranch, selectedBranch.Name); err != nil {
return self.c.Error(err)
}
if err := self.c.Refresh(types.RefreshOptions{
Mode: types.SYNC,
Scope: []types.RefreshableView{
types.BRANCHES,
types.COMMITS,
},
}); err != nil {
return self.c.Error(err)
}
return nil
})
},