1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-17 21:18:31 +02:00

Extract a FetchCmdObj function so that we can test it

No change in behavior.
This commit is contained in:
Stefan Haller 2023-05-30 18:54:32 +02:00
parent a2bdab2135
commit ee4b9d20b1

View File

@ -53,7 +53,7 @@ type FetchOptions struct {
}
// Fetch fetch git repo
func (self *SyncCommands) Fetch(opts FetchOptions) error {
func (self *SyncCommands) FetchCmdObj(opts FetchOptions) oscommands.ICmdObj {
cmdArgs := NewGitCmd("fetch").ToArgv()
cmdObj := self.cmd.New(cmdArgs)
@ -62,7 +62,12 @@ func (self *SyncCommands) Fetch(opts FetchOptions) error {
} else {
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 {