fix: prevent cmdutils.SilentError
from printing in error handler
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo. -
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
Description
- Prevent
cmdutils.SilentError
from printing out infang.Execute
error handler
Out of the discussions in #8015 (closed) it was found that in the 1.73.0 release that cmdutils.SilentError
was being printed out to the terminal when in earlier versions (1.72.0 and earlier) this was suppressed (e.g. not output to the user). This appears to be a side-effect from the migration to using the go package fang
.
I proposed a solution in this thread: #8015 (comment 2809193061) and in conjunction with @phikai the following patch was created.
Related Issues
Related to #8015 (closed)
How has this been tested?
- Ensure the
glab
credential helper in being used in~/.gitconfig
$ cat ~/.gitconfig | tail -3
[credential "https://gitlab.com"]
helper =
helper = !/usr/local/bin/glab auth git-credential
- Navigate to a repository that requires auth (private repo, etc) and run
git pull
$ git pull
ERROR
Silenterror.
Already up to date.
- Navigate to the gitlab
cli
repo, checkout the listed branch and runmake build
- Either replace the path in
~/.gitconfig
to point to the newly compiled binary, or move the binary to the location of the oldglab
binary. - Navigate to a repository that requires auth (private repo, etc) and run
git pull
again
$ git pull
Already up to date.
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap