Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
ff157f90
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff157f90
编写于
1月 07, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add unshallow as an option for git pull
上级
bba335ab
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
11 deletion
+19
-11
extensions/git/src/api/api1.ts
extensions/git/src/api/api1.ts
+2
-2
extensions/git/src/api/git.d.ts
extensions/git/src/api/git.d.ts
+1
-1
extensions/git/src/git.ts
extensions/git/src/git.ts
+11
-3
extensions/git/src/repository.ts
extensions/git/src/repository.ts
+5
-5
未找到文件。
extensions/git/src/api/api1.ts
浏览文件 @
ff157f90
...
...
@@ -172,8 +172,8 @@ export class ApiRepository implements Repository {
return
this
.
_repository
.
fetch
(
remote
,
ref
,
depth
);
}
pull
():
Promise
<
void
>
{
return
this
.
_repository
.
pull
();
pull
(
unshallow
?:
boolean
):
Promise
<
void
>
{
return
this
.
_repository
.
pull
(
undefined
,
unshallow
);
}
push
(
remoteName
?:
string
,
branchName
?:
string
,
setUpstream
:
boolean
=
false
):
Promise
<
void
>
{
...
...
extensions/git/src/api/git.d.ts
浏览文件 @
ff157f90
...
...
@@ -154,7 +154,7 @@ export interface Repository {
removeRemote
(
name
:
string
):
Promise
<
void
>
;
fetch
(
remote
?:
string
,
ref
?:
string
,
depth
?:
number
):
Promise
<
void
>
;
pull
():
Promise
<
void
>
;
pull
(
unshallow
?:
boolean
):
Promise
<
void
>
;
push
(
remoteName
?:
string
,
branchName
?:
string
,
setUpstream
?:
boolean
):
Promise
<
void
>
;
}
...
...
extensions/git/src/git.ts
浏览文件 @
ff157f90
...
...
@@ -629,6 +629,10 @@ export interface CommitOptions {
empty
?:
boolean
;
}
export
interface
PullOptions
{
unshallow
?:
boolean
;
}
export
enum
ForcePushMode
{
Force
,
ForceWithLease
...
...
@@ -1183,7 +1187,7 @@ export class Repository {
args
.
push
(
'
--prune
'
);
}
if
(
options
.
depth
)
{
if
(
typeof
options
.
depth
===
'
number
'
)
{
args
.
push
(
`--depth=
${
options
.
depth
}
`
);
}
...
...
@@ -1200,8 +1204,12 @@ export class Repository {
}
}
async
pull
(
rebase
?:
boolean
,
remote
?:
string
,
branch
?:
string
):
Promise
<
void
>
{
const
args
=
[
'
pull
'
,
'
--tags
'
,
'
--unshallow
'
];
async
pull
(
rebase
?:
boolean
,
remote
?:
string
,
branch
?:
string
,
options
:
PullOptions
=
{}):
Promise
<
void
>
{
const
args
=
[
'
pull
'
,
'
--tags
'
];
if
(
options
.
unshallow
)
{
args
.
push
(
'
--unshallow
'
);
}
if
(
rebase
)
{
args
.
push
(
'
-r
'
);
...
...
extensions/git/src/repository.ts
浏览文件 @
ff157f90
...
...
@@ -951,7 +951,7 @@ export class Repository implements Disposable {
}
@
throttle
async
pull
(
head
?:
Branch
):
Promise
<
void
>
{
async
pull
(
head
?:
Branch
,
unshallow
?:
boolean
):
Promise
<
void
>
{
let
remote
:
string
|
undefined
;
let
branch
:
string
|
undefined
;
...
...
@@ -960,19 +960,19 @@ export class Repository implements Disposable {
branch
=
`
${
head
.
upstream
.
name
}
`
;
}
return
this
.
pullFrom
(
false
,
remote
,
branch
);
return
this
.
pullFrom
(
false
,
remote
,
branch
,
unshallow
);
}
async
pullFrom
(
rebase
?:
boolean
,
remote
?:
string
,
branch
?:
string
):
Promise
<
void
>
{
async
pullFrom
(
rebase
?:
boolean
,
remote
?:
string
,
branch
?:
string
,
unshallow
?:
boolean
):
Promise
<
void
>
{
await
this
.
run
(
Operation
.
Pull
,
async
()
=>
{
await
this
.
maybeAutoStash
(
async
()
=>
{
const
config
=
workspace
.
getConfiguration
(
'
git
'
,
Uri
.
file
(
this
.
root
));
const
fetchOnPull
=
config
.
get
<
boolean
>
(
'
fetchOnPull
'
);
if
(
fetchOnPull
)
{
await
this
.
repository
.
pull
(
rebase
);
await
this
.
repository
.
pull
(
rebase
,
undefined
,
undefined
,
{
unshallow
}
);
}
else
{
await
this
.
repository
.
pull
(
rebase
,
remote
,
branch
);
await
this
.
repository
.
pull
(
rebase
,
remote
,
branch
,
{
unshallow
}
);
}
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录