Skip to content

Conversation

@whalelines
Copy link
Contributor

@whalelines whalelines commented Jan 18, 2024

- What I did

Escape period (.) so regular expression does not match any character before "git".

- How I did it

Created a failing test, fixed the regular expression, and verified the test passed.

- How to verify it

Run the tests.

- Description for the changelog

Fix IsGitURL regular expression to not match any character before ending "git"

- A picture of a cute animal (not mandatory but encouraged)

two-words

Escape period (.) so regular expression does not match any character before "git".

Signed-off-by: David Dooling <david.dooling@docker.com>
@thaJeztah thaJeztah added this to the 26.0.0 milestone Jan 18, 2024
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

}
invalidGitUrls = []string{
"http://github.com/docker/docker.git:#branch",
"https://github.com/docker/dgit",
Copy link
Member

Choose a reason for hiding this comment

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

We might have to change this example if we revisit docker/cli#1738 (since this really should be a valid Git URL), but these don't have to be real repos so at that point it could change to something like https://example.com/dgit and still be sufficient for the case it's verifying. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants