Merge pull request #47136 from thaJeztah/25.0_backport_git-url-regex

[25.0 backport] Fix isGitURL regular expression
This commit is contained in:
Sebastiaan van Stijn 2024-01-22 15:14:04 +01:00 committed by GitHub
commit c2847b2eb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -12,7 +12,7 @@ import (
// urlPathWithFragmentSuffix matches fragments to use as Git reference and build
// context from the Git repository. See IsGitURL for details.
var urlPathWithFragmentSuffix = regexp.MustCompile(".git(?:#.+)?$")
var urlPathWithFragmentSuffix = regexp.MustCompile(`\.git(?:#.+)?$`)
// IsURL returns true if the provided str is an HTTP(S) URL by checking if it
// has a http:// or https:// scheme. No validation is performed to verify if the

View file

@ -17,6 +17,7 @@ var (
}
invalidGitUrls = []string{
"http://github.com/docker/docker.git:#branch",
"https://github.com/docker/dgit",
}
)