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

Closes #2193 #2194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AtricoSoftware
Copy link

Context is not copied from parent to child
Comment on code states copy if parent has context but code implements copy if child doesn't have context
Fix makes behaviour consistent between root and sub commands w.r.t. contexts

@CLAassistant
Copy link

CLAassistant commented Oct 1, 2024

CLA assistant check
All committers have signed the CLA.

@AtricoSoftware
Copy link
Author

AtricoSoftware commented Oct 1, 2024

Re-pushed and removed check completely - parent context can never be nil so no point checking
Context should always be copied

 - Comment states check parent, code checked child instead
 - No point performing parent check as code above ensures that this is never nil
@lukaspj
Copy link

lukaspj commented Oct 24, 2024

I concur.

This issue makes it very hard to use Cobra in tests so this would be a great fix.

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

Successfully merging this pull request may close these issues.

3 participants