ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / platform / extensionManagement / test / common / configRemotes.test.ts 135 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import assert from 'assert' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js' ;
import { getDomainsOfRemotes, getRemotes } from '../../common/configRemotes.js' ;
suite ( 'Config Remotes' , ( ) => {
ensureNoDisposablesAreLeakedInTestSuite ( ) ;
const allowedDomains = [
'github.com' ,
'github2.com' ,
'github3.com' ,
'example.com' ,
'example2.com' ,
'example3.com' ,
'server.org' ,
'server2.org'
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
assert allowedDomains
config remote
assert config allowedDomains
config remote
assert config allowedDomains
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
config remote
assert config
assert config
noDotGitConfig remote
assert config noDotGitConfig
url
,
]
;
test
(
'HTTPS remotes'
,
function
(
)
{
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'https://github.com/microsoft/vscode.git'
)
,
)
,
[
'github.com'
]
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'https://git.example.com/gitproject.git'
)
,
)
,
[
'example.com'
]
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'https://username@github2.com/username/repository.git'
)
,
)
,
[
'github2.com'
]
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'https://username:password@github3.com/username/repository.git'
)
,
)
,
[
'github3.com'
]
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'https://username:password@example2.com:1234/username/repository.git'
)
,
)
,
[
'example2.com'
]
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'https://example3.com:1234/username/repository.git'
)
,
)
,
[
'example3.com'
]
)
;
}
)
;
test
(
'SSH remotes'
,
function
(
)
{
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'ssh://user@git.server.org/project.git'
)
,
)
,
[
'server.org'
]
)
;
}
)
;
test
(
'SCP-like remotes'
,
function
(
)
{
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'git@github.com:microsoft/vscode.git'
)
,
)
,
[
'github.com'
]
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'user@git.server.org:project.git'
)
,
)
,
[
'server.org'
]
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'git.server2.org:project.git'
)
,
)
,
[
'server2.org'
]
)
;
}
)
;
test
(
'Local remotes'
,
function
(
)
{
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'/opt/git/project.git'
)
,
)
,
[
]
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
remote
(
'file:///opt/git/project.git'
)
,
)
,
[
]
)
;
}
)
;
test
(
'Multiple remotes'
,
function
(
)
{
const
=
[
'https://github.com/microsoft/vscode.git'
,
'https://git.example.com/gitproject.git'
]
.
map
(
)
.
join
(
''
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
,
)
.
sort
(
)
,
[
'example.com'
,
'github.com'
]
)
;
}
)
;
test
(
'Non allowed domains are anonymized'
,
(
)
=>
{
const
=
[
'https://github.com/microsoft/vscode.git'
,
'https://git.foobar.com/gitproject.git'
]
.
map
(
)
.
join
(
''
)
;
.
deepStrictEqual
(
getDomainsOfRemotes
(
,
)
.
sort
(
)
,
[
'aaaaaa.aaa'
,
'github.com'
]
)
;
}
)
;
test
(
'HTTPS remotes to be hashed'
,
function
(
)
{
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://github.com/microsoft/vscode.git'
)
)
,
[
'github.com/microsoft/vscode.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://git.example.com/gitproject.git'
)
)
,
[
'git.example.com/gitproject.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username@github2.com/username/repository.git'
)
)
,
[
'github2.com/username/repository.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username:password@github3.com/username/repository.git'
)
)
,
[
'github3.com/username/repository.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username:password@example2.com:1234/username/repository.git'
)
)
,
[
'example2.com/username/repository.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://example3.com:1234/username/repository.git'
)
)
,
[
'example3.com/username/repository.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://github.com/microsoft/vscode.git'
)
,
true
)
,
[
'github.com/microsoft/vscode'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://git.example.com/gitproject.git'
)
,
true
)
,
[
'git.example.com/gitproject'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username@github2.com/username/repository.git'
)
,
true
)
,
[
'github2.com/username/repository'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username:password@github3.com/username/repository.git'
)
,
true
)
,
[
'github3.com/username/repository'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username:password@example2.com:1234/username/repository.git'
)
,
true
)
,
[
'example2.com/username/repository'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://example3.com:1234/username/repository.git'
)
,
true
)
,
[
'example3.com/username/repository'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://github.com/microsoft/vscode.git'
)
,
true
)
,
getRemotes
(
remote
(
'https://github.com/microsoft/vscode'
)
)
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://git.example.com/gitproject.git'
)
,
true
)
,
getRemotes
(
remote
(
'https://git.example.com/gitproject'
)
)
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username@github2.com/username/repository.git'
)
,
true
)
,
getRemotes
(
remote
(
'https://username@github2.com/username/repository'
)
)
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username:password@github3.com/username/repository.git'
)
,
true
)
,
getRemotes
(
remote
(
'https://username:password@github3.com/username/repository'
)
)
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://username:password@example2.com:1234/username/repository.git'
)
,
true
)
,
getRemotes
(
remote
(
'https://username:password@example2.com:1234/username/repository'
)
)
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'https://example3.com:1234/username/repository.git'
)
,
true
)
,
getRemotes
(
remote
(
'https://example3.com:1234/username/repository'
)
)
)
;
}
)
;
test
(
'SSH remotes to be hashed'
,
function
(
)
{
.
deepStrictEqual
(
getRemotes
(
remote
(
'ssh://user@git.server.org/project.git'
)
)
,
[
'git.server.org/project.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'ssh://user@git.server.org/project.git'
)
,
true
)
,
[
'git.server.org/project'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'ssh://user@git.server.org/project.git'
)
,
true
)
,
getRemotes
(
remote
(
'ssh://user@git.server.org/project'
)
)
)
;
}
)
;
test
(
'SCP-like remotes to be hashed'
,
function
(
)
{
.
deepStrictEqual
(
getRemotes
(
remote
(
'git@github.com:microsoft/vscode.git'
)
)
,
[
'github.com/microsoft/vscode.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'user@git.server.org:project.git'
)
)
,
[
'git.server.org/project.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'git.server2.org:project.git'
)
)
,
[
'git.server2.org/project.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'git@github.com:microsoft/vscode.git'
)
,
true
)
,
[
'github.com/microsoft/vscode'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'user@git.server.org:project.git'
)
,
true
)
,
[
'git.server.org/project'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'git.server2.org:project.git'
)
,
true
)
,
[
'git.server2.org/project'
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'git@github.com:microsoft/vscode.git'
)
,
true
)
,
getRemotes
(
remote
(
'git@github.com:microsoft/vscode'
)
)
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'user@git.server.org:project.git'
)
,
true
)
,
getRemotes
(
remote
(
'user@git.server.org:project'
)
)
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'git.server2.org:project.git'
)
,
true
)
,
getRemotes
(
remote
(
'git.server2.org:project'
)
)
)
;
}
)
;
test
(
'Local remotes to be hashed'
,
function
(
)
{
.
deepStrictEqual
(
getRemotes
(
remote
(
'/opt/git/project.git'
)
)
,
[
]
)
;
.
deepStrictEqual
(
getRemotes
(
remote
(
'file:///opt/git/project.git'
)
)
,
[
]
)
;
}
)
;
test
(
'Multiple remotes to be hashed'
,
function
(
)
{
const
=
[
'https://github.com/microsoft/vscode.git'
,
'https://git.example.com/gitproject.git'
]
.
map
(
)
.
join
(
' '
)
;
.
deepStrictEqual
(
getRemotes
(
)
,
[
'github.com/microsoft/vscode.git'
,
'git.example.com/gitproject.git'
]
)
;
.
deepStrictEqual
(
getRemotes
(
,
true
)
,
[
'github.com/microsoft/vscode'
,
'git.example.com/gitproject'
]
)
;
const
=
[
'https://github.com/microsoft/vscode'
,
'https://git.example.com/gitproject'
]
.
map
(
)
.
join
(
' '
)
;
.
deepStrictEqual
(
getRemotes
(
,
true
)
,
getRemotes
(
)
)
;
}
)
;
function
remote
(
:
string
)
:
string
{
return
` [remote "origin"]
url = ${ url}
fetch = +refs/heads/*:refs/remotes/origin/*
`
;
}
}
)
;