diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-01-12 12:55:03 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-01-14 12:56:48 +0300 |
commit | 85154e0ae523e030994388199fc548ee31953e29 (patch) | |
tree | b79ccac6de4915306c410827526647a47bb55ee1 | |
parent | b10b939c71e5e35f61d90d98b78e66c442b50d84 (diff) |
repository: Silence progress meter of FetchSourceBranch
By default, git-fetch(1) will print the progress of the fetch as well as
all updated references to stderr. Given that we do not catch stderr when
running this command in the FetchSourceBranch RPC, those progress
messages will end up as useless log messages.
Fix the issue by running git-fetch(1) with the "--quiet" flag. This will
cause it to suppress this output while still reporting real errors.
-rw-r--r-- | changelogs/unreleased/pks-fetch-source-branch-quiet.yml | 5 | ||||
-rw-r--r-- | internal/gitaly/service/repository/fetch.go | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/changelogs/unreleased/pks-fetch-source-branch-quiet.yml b/changelogs/unreleased/pks-fetch-source-branch-quiet.yml new file mode 100644 index 000000000..f3db079a4 --- /dev/null +++ b/changelogs/unreleased/pks-fetch-source-branch-quiet.yml @@ -0,0 +1,5 @@ +--- +title: 'repository: Silence progress meter of FetchSourceBranch' +merge_request: 2991 +author: +type: fixed diff --git a/internal/gitaly/service/repository/fetch.go b/internal/gitaly/service/repository/fetch.go index 363aa1974..417e1f2f8 100644 --- a/internal/gitaly/service/repository/fetch.go +++ b/internal/gitaly/service/repository/fetch.go @@ -85,7 +85,7 @@ func (s *server) FetchSourceBranch(ctx context.Context, req *gitalypb.FetchSourc git.SubCmd{ Name: "fetch", Args: []string{gitalyssh.GitalyInternalURL, sourceOid}, - Flags: []git.Option{git.Flag{Name: "--no-tags"}}, + Flags: []git.Option{git.Flag{Name: "--no-tags"}, git.Flag{Name: "--quiet"}}, }, git.WithEnv(env...), git.WithRefTxHook(ctx, req.Repository, s.cfg), |