forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git: update parsing to clarify between scp-style urls
This should also resolve the ports parsing issue. Co-authored-by: Aaron Lehmann <[email protected]> Signed-off-by: Justin Chadwell <[email protected]>
- Loading branch information
1 parent
e84cc9e
commit 50e75e3
Showing
9 changed files
with
276 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ func TestNewGitIdentifier(t *testing.T) { | |
{ | ||
url: "[email protected]:moby/buildkit.git", | ||
expected: GitIdentifier{ | ||
Remote: "[email protected]:moby/buildkit.git", | ||
Remote: "ssh://[email protected]/moby/buildkit.git", | ||
}, | ||
}, | ||
{ | ||
|
@@ -75,13 +75,13 @@ func TestNewGitIdentifier(t *testing.T) { | |
{ | ||
url: "[email protected]:user/repo.git", | ||
expected: GitIdentifier{ | ||
Remote: "[email protected]:user/repo.git", | ||
Remote: "ssh://[email protected]/user/repo.git", | ||
}, | ||
}, | ||
{ | ||
url: "[email protected]:user/repo.git#mybranch:mydir/mysubdir/", | ||
expected: GitIdentifier{ | ||
Remote: "[email protected]:user/repo.git", | ||
Remote: "ssh://[email protected]/user/repo.git", | ||
Ref: "mybranch", | ||
Subdir: "mydir/mysubdir/", | ||
}, | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,13 @@ func TestParseGitRef(t *testing.T) { | |
IndistinguishableFromLocal: true, | ||
}, | ||
}, | ||
{ | ||
ref: "custom.xyz/moby/buildkit.git", | ||
expected: &GitRef{ | ||
Remote: "https://custom.xyz/moby/buildkit.git", | ||
ShortName: "buildkit", | ||
}, | ||
}, | ||
{ | ||
ref: "https://github.com/moby/buildkit", | ||
expected: nil, | ||
|
@@ -77,24 +84,31 @@ func TestParseGitRef(t *testing.T) { | |
ShortName: "buildkit", | ||
}, | ||
}, | ||
{ | ||
ref: "https://foo:[email protected]/moby/buildkit.git", | ||
expected: &GitRef{ | ||
Remote: "https://foo:[email protected]/moby/buildkit.git", | ||
ShortName: "buildkit", | ||
}, | ||
}, | ||
{ | ||
ref: "[email protected]:moby/buildkit", | ||
expected: &GitRef{ | ||
Remote: "[email protected]:moby/buildkit", | ||
Remote: "ssh://[email protected]/moby/buildkit", | ||
ShortName: "buildkit", | ||
}, | ||
}, | ||
{ | ||
ref: "[email protected]:moby/buildkit.git", | ||
expected: &GitRef{ | ||
Remote: "[email protected]:moby/buildkit.git", | ||
Remote: "ssh://[email protected]/moby/buildkit.git", | ||
ShortName: "buildkit", | ||
}, | ||
}, | ||
{ | ||
ref: "[email protected]:atlassianlabs/atlassian-docker.git", | ||
expected: &GitRef{ | ||
Remote: "[email protected]:atlassianlabs/atlassian-docker.git", | ||
Remote: "ssh://[email protected]/atlassianlabs/atlassian-docker.git", | ||
ShortName: "atlassian-docker", | ||
}, | ||
}, | ||
|
Oops, something went wrong.