Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
689c38f4
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
689c38f4
编写于
7月 06, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
4215f962
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
34 deletion
+24
-34
extensions/git/package.json
extensions/git/package.json
+4
-4
extensions/git/package.nls.json
extensions/git/package.nls.json
+1
-1
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+13
-23
extensions/git/src/model.ts
extensions/git/src/model.ts
+6
-6
未找到文件。
extensions/git/package.json
浏览文件 @
689c38f4
...
...
@@ -39,8 +39,8 @@
}
},
{
"command"
:
"git.
loadRepo
"
,
"title"
:
"%command.
loadRepo
%"
,
"command"
:
"git.
openRepository
"
,
"title"
:
"%command.
openRepository
%"
,
"category"
:
"Git"
,
"icon"
:
{
"light"
:
"resources/icons/light/git.svg"
,
...
...
@@ -346,7 +346,7 @@
"when"
:
"config.git.enabled"
},
{
"command"
:
"git.
loadRepo
"
,
"command"
:
"git.
openRepository
"
,
"when"
:
"config.git.enabled"
},
{
...
...
@@ -549,7 +549,7 @@
"when"
:
"config.git.enabled && !scmProvider && gitOpenRepositoryCount == 0 && workspaceFolderCount != 0"
},
{
"command"
:
"git.
loadRepo
"
,
"command"
:
"git.
openRepository
"
,
"group"
:
"navigation"
,
"when"
:
"config.git.enabled && !scmProvider && gitOpenRepositoryCount == 0 && workspaceFolderCount != 0"
},
...
...
extensions/git/package.nls.json
浏览文件 @
689c38f4
...
...
@@ -3,7 +3,7 @@
"description"
:
"Git SCM Integration"
,
"command.clone"
:
"Clone"
,
"command.init"
:
"Initialize Repository"
,
"command.
loadRepo"
:
"Load Repo
"
,
"command.
openRepository"
:
"Open Repository
"
,
"command.close"
:
"Close Repository"
,
"command.refresh"
:
"Refresh"
,
"command.openChange"
:
"Open Changes"
,
...
...
extensions/git/src/commands.ts
浏览文件 @
689c38f4
...
...
@@ -501,38 +501,28 @@ export class CommandCenter {
}
await
this
.
git
.
init
(
path
);
await
this
.
model
.
tryO
penRepository
(
path
);
await
this
.
model
.
o
penRepository
(
path
);
}
@
command
(
'
git.loadRepo
'
,
{
repository
:
false
})
async
loadRepo
(
path
?:
string
):
Promise
<
void
>
{
@
command
(
'
git.openRepository
'
,
{
repository
:
false
})
async
openRepository
(
path
?:
string
):
Promise
<
void
>
{
if
(
!
path
)
{
path
=
await
window
.
showInputBox
({
prompt
:
localize
(
'
repopath
'
,
"
Repository Path
"
),
ignoreFocusOut
:
true
const
result
=
await
window
.
showOpenDialog
({
canSelectFiles
:
false
,
canSelectFolders
:
true
,
canSelectMany
:
false
,
defaultUri
:
Uri
.
file
(
os
.
homedir
()),
openLabel
:
localize
(
'
open repo
'
,
"
Open Repository
"
)
});
}
if
(
path
)
{
try
{
if
(
this
.
model
.
getRepository
(
path
))
{
await
this
.
model
.
tryOpenRepository
(
path
);
}
else
{
window
.
showInformationMessage
(
localize
(
'
notfound
'
,
"
Could not find a repository at this path
"
));
}
if
(
!
result
||
result
.
length
===
0
)
{
return
;
}
catch
(
err
)
{
//If something went wrong, tryOpenRepository should have already given error
}
path
=
result
[
0
].
fsPath
;
}
await
this
.
model
.
openRepository
(
path
);
}
@
command
(
'
git.close
'
,
{
repository
:
true
})
...
...
extensions/git/src/model.ts
浏览文件 @
689c38f4
...
...
@@ -99,7 +99,7 @@ export class Model {
children
.
filter
(
child
=>
child
!==
'
.git
'
)
.
forEach
(
child
=>
this
.
tryO
penRepository
(
path
.
join
(
root
,
child
)));
.
forEach
(
child
=>
this
.
o
penRepository
(
path
.
join
(
root
,
child
)));
}
catch
(
err
)
{
// noop
}
...
...
@@ -118,7 +118,7 @@ export class Model {
@
debounce
(
500
)
private
eventuallyScanPossibleGitRepositories
():
void
{
for
(
const
path
of
this
.
possibleGitRepositoryPaths
)
{
this
.
tryO
penRepository
(
path
);
this
.
o
penRepository
(
path
);
}
this
.
possibleGitRepositoryPaths
.
clear
();
...
...
@@ -139,7 +139,7 @@ export class Model {
.
filter
(
r
=>
!
activeRepositories
.
has
(
r
!
.
repository
))
.
filter
(
r
=>
!
(
workspace
.
workspaceFolders
||
[]).
some
(
f
=>
isDescendant
(
f
.
uri
.
fsPath
,
r
!
.
repository
.
root
)))
as
OpenRepository
[];
possibleRepositoryFolders
.
forEach
(
p
=>
this
.
tryO
penRepository
(
p
.
uri
.
fsPath
));
possibleRepositoryFolders
.
forEach
(
p
=>
this
.
o
penRepository
(
p
.
uri
.
fsPath
));
openRepositoriesToDispose
.
forEach
(
r
=>
r
.
dispose
());
}
...
...
@@ -153,7 +153,7 @@ export class Model {
.
filter
(({
root
})
=>
workspace
.
getConfiguration
(
'
git
'
,
root
).
get
<
boolean
>
(
'
enabled
'
)
!==
true
)
.
map
(({
repository
})
=>
repository
);
possibleRepositoryFolders
.
forEach
(
p
=>
this
.
tryO
penRepository
(
p
.
uri
.
fsPath
));
possibleRepositoryFolders
.
forEach
(
p
=>
this
.
o
penRepository
(
p
.
uri
.
fsPath
));
openRepositoriesToDispose
.
forEach
(
r
=>
r
.
dispose
());
}
...
...
@@ -178,12 +178,12 @@ export class Model {
return
;
}
this
.
tryO
penRepository
(
path
.
dirname
(
uri
.
fsPath
));
this
.
o
penRepository
(
path
.
dirname
(
uri
.
fsPath
));
});
}
@
sequentialize
async
tryO
penRepository
(
path
:
string
):
Promise
<
void
>
{
async
o
penRepository
(
path
:
string
):
Promise
<
void
>
{
if
(
this
.
getRepository
(
path
))
{
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录