Skip to content

Commit

Permalink
Merge pull request #4849 from jedevc/fix-git-ref-to-broad
Browse files Browse the repository at this point in the history
git: restrict definition of git ref to previous behavior
  • Loading branch information
tonistiigi authored Apr 17, 2024
2 parents b6bd514 + 8144ab8 commit 3617025
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion util/gitutil/git_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func ParseGitRef(ref string) (*GitRef, error) {
} else {
remote, err = ParseURL(ref)
if errors.Is(err, ErrUnknownProtocol) {
remote, err = ParseURL("https://" + ref)
return nil, err
}
if err != nil {
return nil, err
Expand Down
7 changes: 2 additions & 5 deletions util/gitutil/git_ref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,8 @@ func TestParseGitRef(t *testing.T) {
},
},
{
ref: "custom.xyz/moby/buildkit.git",
expected: &GitRef{
Remote: "https://custom.xyz/moby/buildkit.git",
ShortName: "buildkit",
},
ref: "custom.xyz/moby/buildkit.git",
expected: nil,
},
{
ref: "https://github.com/moby/buildkit",
Expand Down

0 comments on commit 3617025

Please sign in to comment.