mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-15 01:34:26 +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:
@ -1189,23 +1189,19 @@ func (self *FilesController) onClickMain(opts gocui.ViewMouseBindingOpts) error
|
|||||||
|
|
||||||
func (self *FilesController) fetch() error {
|
func (self *FilesController) fetch() error {
|
||||||
return self.c.WithWaitingStatus(self.c.Tr.FetchingStatus, func(task gocui.Task) 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.
|
// 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
|
// 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
|
// a node and its parent node selected. If we are trying to discard changes to the
|
||||||
|
Reference in New Issue
Block a user