Skip to content

Introduce Remote.IsSupportedUrl() #754

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

Merged
merged 1 commit into from
Jun 8, 2014
Merged

Conversation

Therzok
Copy link
Member

@Therzok Therzok commented Jun 8, 2014

No description provided.

@@ -304,5 +304,19 @@ public void CanNotRenameWhenRemoteWithSameNameExists()
Assert.Throws<NameConflictException>(() => repo.Network.Remotes.Rename("origin", "upstream"));
}
}

[Theory]
[InlineData("[email protected]:org/repo")]
Copy link
Member Author

Choose a reason for hiding this comment

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

I can change the test data to be somewhat more generic, since git, http, https, ftp, ftps have the same standard: protocol://site.com:port/path/to/repo.git. But I guess having them like this doesn't hurt.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we also check that this url is supported?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, that sounds like a great idea!

Copy link
Member Author

Choose a reason for hiding this comment

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

So, should I pack the IsValidUrl to check valid_url and supported_url?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added support for IsSupportedUrl.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I think we should expose both IsValidUrl() and IsSupportedUrl().

Indeed, from a user perspective, knowing that an url is valid may be of little value if it's not supported by the underlying library.

I'd be 👍 to drop IsValidUrl()

Copy link
Member Author

Choose a reason for hiding this comment

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

Dropped IsValidUrl due to IsSupportedUrl being a more enforced version of it.

@nulltoken
Copy link
Member

Awesome! Just a little nitpick before merging this. Could you please reword the commit message?

@Therzok
Copy link
Member Author

Therzok commented Jun 8, 2014

Done.

@nulltoken nulltoken merged commit 9fbeaac into libgit2:vNext Jun 8, 2014
@nulltoken nulltoken added this to the v0.19.0 milestone Jun 8, 2014
@Therzok Therzok deleted the urlValid branch June 8, 2014 21:08
@nulltoken
Copy link
Member

🎱 Thanks!

@nulltoken nulltoken changed the title Introduce Remote.IsValidUrl. Introduce Remote.IsSupportedUrl() Jun 8, 2014
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.

2 participants