Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6029cd4e
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,发现更多精彩内容 >>
未验证
提交
6029cd4e
编写于
11月 04, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'refs/heads/pr/88772'
上级
744eed0a
4f038dba
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
10 deletion
+27
-10
extensions/git/package.json
extensions/git/package.json
+6
-0
extensions/git/package.nls.json
extensions/git/package.nls.json
+1
-0
extensions/git/src/git.ts
extensions/git/src/git.ts
+10
-3
extensions/git/src/repository.ts
extensions/git/src/repository.ts
+10
-7
未找到文件。
extensions/git/package.json
浏览文件 @
6029cd4e
...
...
@@ -1840,6 +1840,12 @@
"default"
:
false
,
"description"
:
"%config.alwaysSignOff%"
},
"git.ignoreSubmodules"
:
{
"type"
:
"boolean"
,
"scope"
:
"resource"
,
"default"
:
false
,
"description"
:
"%config.ignoreSubmodules%"
},
"git.ignoredRepositories"
:
{
"type"
:
"array"
,
"items"
:
{
...
...
extensions/git/package.nls.json
浏览文件 @
6029cd4e
...
...
@@ -138,6 +138,7 @@
"config.detectSubmodulesLimit"
:
"Controls the limit of git submodules detected."
,
"config.alwaysShowStagedChangesResourceGroup"
:
"Always show the Staged Changes resource group."
,
"config.alwaysSignOff"
:
"Controls the signoff flag for all commits."
,
"config.ignoreSubmodules"
:
"Ignore modifications to submodules in the file tree."
,
"config.ignoredRepositories"
:
"List of git repositories to ignore."
,
"config.scanRepositories"
:
"List of paths to search for git repositories in."
,
"config.showProgress"
:
"Controls whether git actions should show progress."
,
...
...
extensions/git/src/git.ts
浏览文件 @
6029cd4e
...
...
@@ -12,7 +12,7 @@ import { EventEmitter } from 'events';
import
*
as
iconv
from
'
iconv-lite-umd
'
;
import
*
as
filetype
from
'
file-type
'
;
import
{
assign
,
groupBy
,
IDisposable
,
toDisposable
,
dispose
,
mkdirp
,
readBytes
,
detectUnicodeEncoding
,
Encoding
,
onceEvent
,
splitInChunks
,
Limiter
}
from
'
./util
'
;
import
{
CancellationToken
,
Progress
,
Uri
}
from
'
vscode
'
;
import
{
CancellationToken
,
Progress
,
Uri
,
workspace
}
from
'
vscode
'
;
import
{
detectEncoding
}
from
'
./encoding
'
;
import
{
Ref
,
RefType
,
Branch
,
Remote
,
GitErrorCodes
,
LogOptions
,
Change
,
Status
,
CommitOptions
,
BranchQuery
}
from
'
./api/git
'
;
import
*
as
byline
from
'
byline
'
;
...
...
@@ -1761,11 +1761,17 @@ export class Repository {
}
}
getStatus(
limit = 5000
): Promise<{ status: IFileStatus[]; didHitLimit: boolean; }> {
getStatus(
opts?: { limit?: number, ignoreSubmodules?: boolean }
): Promise<{ status: IFileStatus[]; didHitLimit: boolean; }> {
return new Promise<{ status: IFileStatus[]; didHitLimit: boolean; }>((c, e) => {
const parser = new GitStatusParser();
const env = { GIT_OPTIONAL_LOCKS: '0' };
const child = this.stream(['status', '-z', '-u'], { env });
const args = ['status', '-z', '-u'];
if (opts?.ignoreSubmodules) {
args.push('--ignore-submodules');
}
const child = this.stream(args, { env });
const onExit = (exitCode: number) => {
if (exitCode !== 0) {
...
...
@@ -1782,6 +1788,7 @@ export class Repository {
c({ status: parser.status, didHitLimit: false });
};
const limit = opts?.limit ?? 5000;
const onStdoutData = (raw: string) => {
parser.update(raw);
...
...
extensions/git/src/repository.ts
浏览文件 @
6029cd4e
...
...
@@ -746,11 +746,11 @@ export class Repository implements Disposable {
onConfigListener
(
updateIndexGroupVisibility
,
this
,
this
.
disposables
);
updateIndexGroupVisibility
();
const
onConfigListenerForBranchSortOrder
=
filterEvent
(
workspace
.
onDidChangeConfiguration
,
e
=>
e
.
affectsConfiguration
(
'
git.branchSortOrder
'
,
root
));
onConfigListenerForBranchSortOrder
(
this
.
updateModelState
,
this
,
this
.
disposables
);
const
onConfigListenerForUntracked
=
filterEvent
(
workspace
.
onDidChangeConfiguration
,
e
=>
e
.
affectsConfiguration
(
'
git.untrackedChanges
'
,
root
));
onConfigListenerForUntracked
(
this
.
updateModelState
,
this
,
this
.
disposables
);
filterEvent
(
workspace
.
onDidChangeConfiguration
,
e
=>
e
.
affectsConfiguration
(
'
git.branchSortOrder
'
,
root
)
||
e
.
affectsConfiguration
(
'
git.untrackedChanges
'
,
root
)
||
e
.
affectsConfiguration
(
'
git.ignoreSubmodules
'
,
root
)
)
(
this
.
updateModelState
,
this
,
this
.
disposables
);
const
updateInputBoxVisibility
=
()
=>
{
const
config
=
workspace
.
getConfiguration
(
'
git
'
,
root
);
...
...
@@ -1524,9 +1524,12 @@ export class Repository implements Disposable {
@
throttle
private
async
updateModelState
():
Promise
<
void
>
{
const
{
status
,
didHitLimit
}
=
await
this
.
repository
.
getStatus
();
const
config
=
workspace
.
getConfiguration
(
'
git
'
);
const
scopedConfig
=
workspace
.
getConfiguration
(
'
git
'
,
Uri
.
file
(
this
.
repository
.
root
));
const
ignoreSubmodules
=
scopedConfig
.
get
<
boolean
>
(
'
ignoreSubmodules
'
);
const
{
status
,
didHitLimit
}
=
await
this
.
repository
.
getStatus
({
ignoreSubmodules
});
const
config
=
workspace
.
getConfiguration
(
'
git
'
);
const
shouldIgnore
=
config
.
get
<
boolean
>
(
'
ignoreLimitWarning
'
)
===
true
;
const
useIcons
=
!
config
.
get
<
boolean
>
(
'
decorations.enabled
'
,
true
);
this
.
isRepositoryHuge
=
didHitLimit
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录