Skip to content
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

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

jedevc
Copy link
Member

@jedevc jedevc commented Jun 27, 2024

Alternative to #5092, fixes #5066.

This option is already correctly specified in gitCLI, the call chain looks like:

  • gitutil.NewCLI(..., gitutil.WithExec(runWithStandardUmask)) called in gitCLI
  • gitCLI called in mountRemote
  • git.New called in mountRemote

The exec field specified by WithExec from the first NewCLI call should propagate down to git.New - but this wasn't being done, I clearly missed this somehow.

@jedevc jedevc added this to the v0.14.2 milestone Jun 27, 2024
@jedevc jedevc requested a review from tonistiigi June 27, 2024 11:14
@tonistiigi
Copy link
Member

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 {
Copy link
Member

@tonistiigi tonistiigi Jun 27, 2024

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.

@tianon
Copy link
Member

tianon commented Jun 27, 2024

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! 😂 ❤️

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

@jedevc
Copy link
Member Author

jedevc commented Jul 2, 2024

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>
@tonistiigi
Copy link
Member

Pushed a test update

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Copy link
Member Author

@jedevc jedevc left a 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 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v0.13+] unexpected permissions on COPY'd files
4 participants