We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50e75e3 commit a8d926aCopy full SHA for a8d926a
util/gitutil/git_ref.go
@@ -2,7 +2,6 @@ package gitutil
2
3
import (
4
"net/url"
5
- "regexp"
6
"strings"
7
8
"github.com/containerd/containerd/errdefs"
@@ -82,8 +81,7 @@ func ParseGitRef(ref string) (*GitRef, error) {
82
81
switch remote.Scheme {
83
// An HTTP(S) URL is considered to be a valid git ref only when it has the ".git[...]" suffix.
84
case HTTPProtocol, HTTPSProtocol:
85
- var gitURLPathWithFragmentSuffix = regexp.MustCompile(`\.git(?:#.+)?$`)
86
- if !gitURLPathWithFragmentSuffix.MatchString(ref) {
+ if !strings.HasSuffix(remote.Path, ".git") {
87
return nil, errdefs.ErrInvalidArgument
88
}
89
0 commit comments