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

refactor: allow passing OsStr as-is to exec_cmd #2997

Merged
merged 1 commit into from Aug 23, 2021

Conversation

davidkna
Copy link
Member

Description

This PR changes utils::exec_cmd and context.exec_cmd to accept AsRef<OsStr> (this includes &str) instead of &str like Command from std.
This allows passing the git folder in the -C argument without .to_string_lossy() (which wouldn't work in the lossy case, but this fix still doesn't seem to fix the issue).

Motivation and Context

Closes #

Screenshots (if appropriate):

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@davidkna davidkna requested a review from a team August 21, 2021 16:11
Copy link
Member

@andytom andytom left a comment

Choose a reason for hiding this comment

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

LGTM

@andytom andytom merged commit 9d3ec93 into starship:master Aug 23, 2021
@davidkna davidkna deleted the refactor-exec-osstr branch March 26, 2022 12:50
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.

None yet

2 participants