mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Inline fetchAux into call site
It's only called from this one place, and the call is a one-liner, so it makes more sense to inline the code there.
This commit is contained in:
parent
3577808a14
commit
2174762315
1 changed files with 10 additions and 14 deletions
|
@ -1189,23 +1189,19 @@ func (self *FilesController) onClickMain(opts gocui.ViewMouseBindingOpts) error
|
|||
|
||||
func (self *FilesController) fetch() error {
|
||||
return self.c.WithWaitingStatus(self.c.Tr.FetchingStatus, func(task gocui.Task) error {
|
||||
return self.fetchAux(task)
|
||||
self.c.LogAction("Fetch")
|
||||
err := self.c.Git().Sync.Fetch(task)
|
||||
|
||||
if err != nil && strings.Contains(err.Error(), "exit status 128") {
|
||||
return errors.New(self.c.Tr.PassUnameWrong)
|
||||
}
|
||||
|
||||
_ = self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.BRANCHES, types.COMMITS, types.REMOTES, types.TAGS}, Mode: types.ASYNC})
|
||||
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
func (self *FilesController) fetchAux(task gocui.Task) (err error) {
|
||||
self.c.LogAction("Fetch")
|
||||
err = self.c.Git().Sync.Fetch(task)
|
||||
|
||||
if err != nil && strings.Contains(err.Error(), "exit status 128") {
|
||||
return errors.New(self.c.Tr.PassUnameWrong)
|
||||
}
|
||||
|
||||
_ = self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.BRANCHES, types.COMMITS, types.REMOTES, types.TAGS}, Mode: types.ASYNC})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Couldn't think of a better term than 'normalised'. Alas.
|
||||
// The idea is that when you select a range of nodes, you will often have both
|
||||
// a node and its parent node selected. If we are trying to discard changes to the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue