mirror of
https://github.com/go-task/task.git
synced 2026-07-08 14:35:18 +00:00
fix: remote taskfiles from ADO git path (#2904)
This commit is contained in:
@@ -2,6 +2,7 @@ package taskfile
|
||||
|
||||
import (
|
||||
"context"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -89,7 +90,10 @@ func getScheme(uri string) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if strings.HasSuffix(strings.Split(u.Path, "//")[0], ".git") && (u.Scheme == "git" || u.Scheme == "ssh" || u.Scheme == "https" || u.Scheme == "http") {
|
||||
isDotGit := strings.HasSuffix(strings.Split(u.Path, "//")[0], ".git")
|
||||
isUnderscoreGit := strings.Contains(strings.Split(u.Path, "//")[0], "/_git/")
|
||||
schemeIsGitCompatible := slices.Contains([]string{"git", "ssh", "https", "http"}, u.Scheme)
|
||||
if (isDotGit || isUnderscoreGit) && schemeIsGitCompatible {
|
||||
return "git", nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user