-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git: ensure exec option is propagated to child git clis #5096
Conversation
We should make sure test coverage catches this case now. |
@@ -119,20 +119,13 @@ func NewGitCLI(opts ...Option) *GitCLI { | |||
// New returns a new git client with the same config as the current one, but | |||
// with the given options applied on top. | |||
func (cli *GitCLI) New(opts ...Option) *GitCLI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be renamed to WithOptions()
or smth. to make it clearer that this is not a constructor but a way to make a new variant of the existing instance with additional config options added.
FWIW, I have now also tested this change and verified it fixes the bug (for completeness, not because I didn't believe it would) ❤️ Happy to see someone who's familiar with this codebase working on it instead of me! 😂 ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
I've seen this, just haven't had a moment to write the test - will look at this as soon as I can. |
Signed-off-by: Justin Chadwell <me@jedevc.com>
35c359b
to
66859e5
Compare
Pushed a test update |
66859e5
to
11c9682
Compare
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
11c9682
to
899cac1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks good to me, thanks @tonistiigi 🙏
Alternative to #5092, fixes #5066.
This option is already correctly specified in
gitCLI
, the call chain looks like:gitutil.NewCLI(..., gitutil.WithExec(runWithStandardUmask))
called ingitCLI
gitCLI
called inmountRemote
git.New
called inmountRemote
The
exec
field specified byWithExec
from the firstNewCLI
call should propagate down togit.New
- but this wasn't being done, I clearly missed this somehow.