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

fix: skip unneeded url parse and only add git+ when needed #3139

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ruben-arts
Copy link
Contributor

@ruben-arts ruben-arts commented Feb 14, 2025

The second time parsing the git URL would remove the git@ from ssh://git@github.. which is not right in this case.

TODO:

  • Add/validate tests

@ruben-arts ruben-arts added the test:extra_slow Run the extra slow tests label Feb 14, 2025
@@ -239,7 +239,7 @@ async fn add_functionality_os() {

/// Test the `pixi add --pypi` functionality
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
#[cfg_attr(not(feature = "slow_integration_tests"), ignore)]
// #[cfg_attr(not(feature = "slow_integration_tests"), ignore)]
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to comment it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oowps nope, did that for testing locally

Copy link
Contributor

@nichmor nichmor left a comment

Choose a reason for hiding this comment

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

let url_str = git.to_string();
let stripped = url_str.strip_prefix("git+").unwrap_or(&url_str);
// Reparse the url with the new scheme, should be safe but could fail so fall back to the original.
Url::parse(stripped).unwrap_or(git.clone())
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not be an actual error? When would it be okay if this fails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test:extra_slow Run the extra slow tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants