git 逻辑

This commit is contained in:
2026-06-10 15:30:52 +08:00
parent 41f2a84979
commit 023ab2f30e
17 changed files with 221 additions and 64 deletions
+2
View File
@@ -44,6 +44,8 @@ func TestValidateRemoteURL(t *testing.T) {
require.NoError(t, ValidateRemoteURL("ssh://git@host/x.git"))
require.Error(t, ValidateRemoteURL("file:///etc/passwd"))
require.Error(t, ValidateRemoteURL("ftp://x"))
// 内嵌凭据(user:pass@)须被拒绝,避免绕过本系统凭据存储
require.Error(t, ValidateRemoteURL("https://user:pass@github.com/x/y.git"))
}
func TestPaths(t *testing.T) {