mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-25 00:46:54 +02:00
Extract a FetchCmdObj function so that we can test it
No change in behavior.
This commit is contained in:
@ -53,7 +53,7 @@ type FetchOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fetch fetch git repo
|
// Fetch fetch git repo
|
||||||
func (self *SyncCommands) Fetch(opts FetchOptions) error {
|
func (self *SyncCommands) FetchCmdObj(opts FetchOptions) oscommands.ICmdObj {
|
||||||
cmdArgs := NewGitCmd("fetch").ToArgv()
|
cmdArgs := NewGitCmd("fetch").ToArgv()
|
||||||
|
|
||||||
cmdObj := self.cmd.New(cmdArgs)
|
cmdObj := self.cmd.New(cmdArgs)
|
||||||
@ -62,7 +62,12 @@ func (self *SyncCommands) Fetch(opts FetchOptions) error {
|
|||||||
} else {
|
} else {
|
||||||
cmdObj.PromptOnCredentialRequest()
|
cmdObj.PromptOnCredentialRequest()
|
||||||
}
|
}
|
||||||
return cmdObj.WithMutex(self.syncMutex).Run()
|
return cmdObj.WithMutex(self.syncMutex)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *SyncCommands) Fetch(opts FetchOptions) error {
|
||||||
|
cmdObj := self.FetchCmdObj(opts)
|
||||||
|
return cmdObj.Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
type PullOptions struct {
|
type PullOptions struct {
|
||||||
|
Reference in New Issue
Block a user