Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a308b39f
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,发现更多精彩内容 >>
提交
a308b39f
编写于
7月 26, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean all paths
fixes #8590
上级
767b11e9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
7 deletion
+15
-7
src/vs/base/common/arrays.ts
src/vs/base/common/arrays.ts
+8
-4
src/vs/workbench/parts/git/node/git.lib.ts
src/vs/workbench/parts/git/node/git.lib.ts
+7
-3
未找到文件。
src/vs/base/common/arrays.ts
浏览文件 @
a308b39f
...
@@ -257,8 +257,12 @@ export function fill<T>(num: number, valueFn: () => T, arr: T[] = []): T[] {
...
@@ -257,8 +257,12 @@ export function fill<T>(num: number, valueFn: () => T, arr: T[] = []): T[] {
return
arr
;
return
arr
;
}
}
export
function
index
<
T
>
(
array
:
T
[],
indexer
:
(
t
:
T
)
=>
string
):
{
[
key
:
string
]:
T
;
}
{
export
function
index
<
T
>
(
array
:
T
[],
indexer
:
(
t
:
T
)
=>
string
):
{
[
key
:
string
]:
T
;
};
const
result
=
Object
.
create
(
null
);
export
function
index
<
T
,
R
>
(
array
:
T
[],
indexer
:
(
t
:
T
)
=>
string
,
merger
?:
(
t
:
T
,
r
:
R
)
=>
R
):
{
[
key
:
string
]:
R
;
};
array
.
forEach
(
t
=>
result
[
indexer
(
t
)]
=
t
);
export
function
index
<
T
,
R
>
(
array
:
T
[],
indexer
:
(
t
:
T
)
=>
string
,
merger
:
(
t
:
T
,
r
:
R
)
=>
R
=
t
=>
t
as
any
):
{
[
key
:
string
]:
R
;
}
{
return
result
;
return
array
.
reduce
((
r
,
t
)
=>
{
const
key
=
indexer
(
t
);
r
[
key
]
=
merger
(
t
,
r
[
key
]);
return
r
;
},
Object
.
create
(
null
));
}
}
\ No newline at end of file
src/vs/workbench/parts/git/node/git.lib.ts
浏览文件 @
a308b39f
...
@@ -11,9 +11,10 @@ import * as pfs from 'vs/base/node/pfs';
...
@@ -11,9 +11,10 @@ import * as pfs from 'vs/base/node/pfs';
import
{
guessMimeTypes
,
isBinaryMime
}
from
'
vs/base/common/mime
'
;
import
{
guessMimeTypes
,
isBinaryMime
}
from
'
vs/base/common/mime
'
;
import
{
IDisposable
,
toDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
toDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
sequence
}
from
'
vs/base/common/async
'
;
import
{
v4
as
UUIDv4
}
from
'
vs/base/common/uuid
'
;
import
{
v4
as
UUIDv4
}
from
'
vs/base/common/uuid
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
uniqueFilter
}
from
'
vs/base/common/arrays
'
;
import
{
uniqueFilter
,
index
}
from
'
vs/base/common/arrays
'
;
import
{
IRawFileStatus
,
RefType
,
IRef
,
IBranch
,
IRemote
,
GitErrorCodes
,
IPushOptions
}
from
'
vs/workbench/parts/git/common/git
'
;
import
{
IRawFileStatus
,
RefType
,
IRef
,
IBranch
,
IRemote
,
GitErrorCodes
,
IPushOptions
}
from
'
vs/workbench/parts/git/common/git
'
;
import
{
detectMimesFromStream
}
from
'
vs/base/node/mime
'
;
import
{
detectMimesFromStream
}
from
'
vs/base/node/mime
'
;
import
{
IFileOperationResult
,
FileOperationResult
}
from
'
vs/platform/files/common/files
'
;
import
{
IFileOperationResult
,
FileOperationResult
}
from
'
vs/platform/files/common/files
'
;
...
@@ -447,8 +448,11 @@ export class Repository {
...
@@ -447,8 +448,11 @@ export class Repository {
}
}
clean
(
paths
:
string
[]):
Promise
{
clean
(
paths
:
string
[]):
Promise
{
const
args
=
[
'
clean
'
,
'
-f
'
,
'
-q
'
,
'
--
'
].
concat
(
paths
);
const
byDirname
=
index
<
string
,
string
[]
>
(
paths
,
p
=>
path
.
dirname
(
p
),
(
p
,
r
)
=>
(
r
||
[]).
concat
([
p
]));
return
this
.
run
(
args
);
const
groups
=
Object
.
keys
(
byDirname
).
map
(
key
=>
byDirname
[
key
]);
const
tasks
=
groups
.
map
(
group
=>
()
=>
this
.
run
([
'
clean
'
,
'
-f
'
,
'
-q
'
,
'
--
'
].
concat
(
group
)));
return
sequence
(
tasks
);
}
}
undo
():
Promise
{
undo
():
Promise
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录