diff options
author | Justin Tobler <jtobler@gitlab.com> | 2023-09-22 01:21:38 +0300 |
---|---|---|
committer | Justin Tobler <jtobler@gitlab.com> | 2023-10-19 21:47:56 +0300 |
commit | f622dd25c5ab469547e9c56347a16f6e681e6f3a (patch) | |
tree | fec745810d83122032477db4c8bced60dbd3db67 | |
parent | 4f139c55086dfe24a27195eccf385105fdcb07dc (diff) |
localrepo: Support stdout configuration for `FetchRemote`
In a future commit, updated references need to be extracted from
`git-fetch(1)` output performed during `FetchRemote`. This change
introduces configuration to `localrepo.FetchRemote()` to configure
stdout.
-rw-r--r-- | internal/git/localrepo/remote.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/git/localrepo/remote.go b/internal/git/localrepo/remote.go index d6b6660c9..f2838c4c3 100644 --- a/internal/git/localrepo/remote.go +++ b/internal/git/localrepo/remote.go @@ -50,6 +50,8 @@ type FetchOpts struct { // https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---tags // https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---no-tags Tags FetchOptsTags + // Stdout if set it would be used to redirect stdout stream into it. + Stdout io.Writer // Stderr if set it would be used to redirect stderr stream into it. Stderr io.Writer // DisableTransactions will disable the reference-transaction hook and atomic transactions. @@ -80,6 +82,7 @@ func (repo *Repo) FetchRemote(ctx context.Context, remoteName string, opts Fetch commandOptions := []git.CmdOpt{ git.WithEnv(opts.Env...), + git.WithStdout(opts.Stdout), git.WithStderr(opts.Stderr), git.WithConfig(git.ConfigPair{ // Git is so kind to point out that we asked it to not show forced updates |