1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

feat(remote): support include git remote (#1652)

This commit is contained in:
Valentin Maerten
2024-09-24 13:44:54 -04:00
committed by GitHub
parent d1dc271b9a
commit e6ea0647d7
9 changed files with 407 additions and 13 deletions

22
taskfile/node_test.go Normal file
View File

@@ -0,0 +1,22 @@
package taskfile
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestScheme(t *testing.T) {
scheme, err := getScheme("https://github.com/foo/bar.git")
assert.NoError(t, err)
assert.Equal(t, "git", scheme)
scheme, err = getScheme("https://github.com/foo/bar.git?ref=v1//taskfile/common.yml")
assert.NoError(t, err)
assert.Equal(t, "git", scheme)
scheme, err = getScheme("git@github.com:foo/bar.git?ref=main//Taskfile.yml")
assert.NoError(t, err)
assert.Equal(t, "git", scheme)
scheme, err = getScheme("https://github.com/foo/common.yml")
assert.NoError(t, err)
assert.Equal(t, "https", scheme)
}