Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -83,6 +83,32 @@ func TestParseRemoteURL(t *testing.T) {
|
| 83 | 83 |
subdir: "mydir/mysubdir/", |
| 84 | 84 |
}, |
| 85 | 85 |
}, |
| 86 |
+ {
|
|
| 87 |
+ doc: "ssh, no url-fragment", |
|
| 88 |
+ url: "ssh://github.com/user/repo.git", |
|
| 89 |
+ expected: gitRepo{
|
|
| 90 |
+ remote: "ssh://github.com/user/repo.git", |
|
| 91 |
+ ref: "master", |
|
| 92 |
+ }, |
|
| 93 |
+ }, |
|
| 94 |
+ {
|
|
| 95 |
+ doc: "ssh, with url-fragment", |
|
| 96 |
+ url: "ssh://github.com/user/repo.git#mybranch:mydir/mysubdir/", |
|
| 97 |
+ expected: gitRepo{
|
|
| 98 |
+ remote: "ssh://github.com/user/repo.git", |
|
| 99 |
+ ref: "mybranch", |
|
| 100 |
+ subdir: "mydir/mysubdir/", |
|
| 101 |
+ }, |
|
| 102 |
+ }, |
|
| 103 |
+ {
|
|
| 104 |
+ doc: "ssh, with url-fragment and user", |
|
| 105 |
+ url: "ssh://foo%40barcorp.com@github.com/user/repo.git#mybranch:mydir/mysubdir/", |
|
| 106 |
+ expected: gitRepo{
|
|
| 107 |
+ remote: "ssh://foo%40barcorp.com@github.com/user/repo.git", |
|
| 108 |
+ ref: "mybranch", |
|
| 109 |
+ subdir: "mydir/mysubdir/", |
|
| 110 |
+ }, |
|
| 111 |
+ }, |
|
| 86 | 112 |
} |
| 87 | 113 |
|
| 88 | 114 |
for _, tc := range tests {
|