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

Update Clone dialog's handling of clipboard text #9266

Merged
merged 1 commit into from Jun 6, 2021

Conversation

nyankoframe
Copy link
Contributor

Fixes #6260

Proposed changes

  • Adds a new method in FormClone to extract a URL from a text string.
  • Updates Clone form to use new method

Test methodology

  • Manual testing
  • Added new integration test in FormCloneTests.cs

Test environment(s)

  • GIT 2.31.0.windows.1
  • Windows 10.0.19043.985

✒️ I contribute this code under The Developer Certificate of Origin.

This change adds a new FormClone.TryExtractUrl method
to split a string by spaces and extract the first string for which
Uri.IsWellFormedUriString returns true.

A new integration test is added for FormClone to validate the
behavior of the new method.

This change updates the Clone dialog to use the new method
for extracting URLs from clipboard contents.

Calls to PathUtil.IsUrl are replaced by direct calls to
Uri.IsWellFormedUriString.

(cherry-picked from commit d462673)
@ghost ghost assigned nyankoframe Jun 6, 2021
@nyankoframe
Copy link
Contributor Author

This is a cherry-pick of #9116 into the master branch, as requested in #9116 (comment)

Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

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

Thank you

@mstv mstv merged commit a32fe7a into gitextensions:master Jun 6, 2021
@ghost ghost added this to the 3.6 milestone Jun 6, 2021
@nyankoframe nyankoframe deleted the update_clone_url_handling branch June 6, 2021 23:26
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.

Detect 'git clone' prefix and ignore
3 participants