summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-05-30 18:54:32 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-05-31 15:54:20 +0200
commitee4b9d20b14d1b856fed3889f574a4e8f0fa661f (patch)
tree2627830d597741ad58ae1c04872a1d6e105ff87f /pkg
parenta2bdab21357483cc3f95b1c868cb749d35bf6170 (diff)
Extract a FetchCmdObj function so that we can test it
No change in behavior.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/git_commands/sync.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/commands/git_commands/sync.go b/pkg/commands/git_commands/sync.go
index 515d0e4d8..c56422029 100644
--- a/pkg/commands/git_commands/sync.go
+++ b/pkg/commands/git_commands/sync.go
@@ -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 {