Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6b37647f
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,发现更多精彩内容 >>
未验证
提交
6b37647f
编写于
10月 17, 2019
作者:
A
Andre Weinand
提交者:
GitHub
10月 17, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into fix/78014/Fix-Special-Character
上级
e3e69756
833f443d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
5 deletion
+40
-5
build/win32/Cargo.lock
build/win32/Cargo.lock
+1
-1
build/win32/inno_updater.exe
build/win32/inno_updater.exe
+0
-0
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+1
-1
extensions/git/src/git.ts
extensions/git/src/git.ts
+38
-3
未找到文件。
build/win32/Cargo.lock
浏览文件 @
6b37647f
...
...
@@ -29,7 +29,7 @@ dependencies = [
[[package]]
name = "inno_updater"
version = "0.8.
0
"
version = "0.8.
2
"
dependencies = [
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crc 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
...
...
build/win32/inno_updater.exe
浏览文件 @
6b37647f
无法预览此类型文件
extensions/git/src/commands.ts
浏览文件 @
6b37647f
...
...
@@ -493,7 +493,7 @@ export class CommandCenter {
const
repositoryPath
=
await
window
.
withProgress
(
opts
,
(
_
,
token
)
=>
this
.
git
.
clone
(
url
!
,
parentPath
,
token
)
(
progress
,
token
)
=>
this
.
git
.
clone
(
url
!
,
parentPath
,
progress
,
token
)
);
let
message
=
localize
(
'
proposeopen
'
,
"
Would you like to open the cloned repository?
"
);
...
...
extensions/git/src/git.ts
浏览文件 @
6b37647f
...
...
@@ -12,10 +12,12 @@ import { EventEmitter } from 'events';
import
iconv
=
require
(
'
iconv-lite
'
);
import
*
as
filetype
from
'
file-type
'
;
import
{
assign
,
groupBy
,
denodeify
,
IDisposable
,
toDisposable
,
dispose
,
mkdirp
,
readBytes
,
detectUnicodeEncoding
,
Encoding
,
onceEvent
,
splitInChunks
,
Limiter
}
from
'
./util
'
;
import
{
CancellationToken
}
from
'
vscode
'
;
import
{
CancellationToken
,
Progress
}
from
'
vscode
'
;
import
{
URI
}
from
'
vscode-uri
'
;
import
{
detectEncoding
}
from
'
./encoding
'
;
import
{
Ref
,
RefType
,
Branch
,
Remote
,
GitErrorCodes
,
LogOptions
,
Change
,
Status
}
from
'
./api/git
'
;
import
*
as
byline
from
'
byline
'
;
import
{
StringDecoder
}
from
'
string_decoder
'
;
// https://github.com/microsoft/vscode/issues/65693
const
MAX_CLI_LENGTH
=
30000
;
...
...
@@ -163,6 +165,7 @@ export interface SpawnOptions extends cp.SpawnOptions {
encoding
?:
string
;
log
?:
boolean
;
cancellationToken
?:
CancellationToken
;
onSpawn
?:
(
childProcess
:
cp
.
ChildProcess
)
=>
void
;
}
async
function
exec
(
child
:
cp
.
ChildProcess
,
cancellationToken
?:
CancellationToken
):
Promise
<
IExecutionResult
<
Buffer
>>
{
...
...
@@ -341,7 +344,7 @@ export class Git {
return
;
}
async
clone
(
url
:
string
,
parentPath
:
string
,
cancellationToken
?:
CancellationToken
):
Promise
<
string
>
{
async
clone
(
url
:
string
,
parentPath
:
string
,
progress
:
Progress
<
{
increment
:
number
}
>
,
cancellationToken
?:
CancellationToken
):
Promise
<
string
>
{
let
baseFolderName
=
decodeURI
(
url
).
replace
(
/
[\/]
+$/
,
''
).
replace
(
/^.*
[\/\\]
/
,
''
).
replace
(
/
\.
git$/
,
''
)
||
'
repository
'
;
let
folderName
=
baseFolderName
;
let
folderPath
=
path
.
join
(
parentPath
,
folderName
);
...
...
@@ -354,8 +357,36 @@ export class Git {
await
mkdirp
(
parentPath
);
const
onSpawn
=
(
child
:
cp
.
ChildProcess
)
=>
{
const
decoder
=
new
StringDecoder
(
'
utf8
'
);
const
lineStream
=
new
byline
.
LineStream
({
encoding
:
'
utf8
'
});
child
.
stderr
.
on
(
'
data
'
,
(
buffer
:
Buffer
)
=>
lineStream
.
write
(
decoder
.
write
(
buffer
)));
let
totalProgress
=
0
;
let
previousProgress
=
0
;
lineStream
.
on
(
'
data
'
,
(
line
:
string
)
=>
{
let
match
:
RegExpMatchArray
|
null
=
null
;
if
(
match
=
/Counting objects:
\s
*
(\d
+
)
%/i
.
exec
(
line
))
{
totalProgress
=
Math
.
floor
(
parseInt
(
match
[
1
])
*
0.1
);
}
else
if
(
match
=
/Compressing objects:
\s
*
(\d
+
)
%/i
.
exec
(
line
))
{
totalProgress
=
10
+
Math
.
floor
(
parseInt
(
match
[
1
])
*
0.1
);
}
else
if
(
match
=
/Receiving objects:
\s
*
(\d
+
)
%/i
.
exec
(
line
))
{
totalProgress
=
20
+
Math
.
floor
(
parseInt
(
match
[
1
])
*
0.4
);
}
else
if
(
match
=
/Resolving deltas:
\s
*
(\d
+
)
%/i
.
exec
(
line
))
{
totalProgress
=
60
+
Math
.
floor
(
parseInt
(
match
[
1
])
*
0.4
);
}
if
(
totalProgress
!==
previousProgress
)
{
progress
.
report
({
increment
:
totalProgress
-
previousProgress
});
previousProgress
=
totalProgress
;
}
});
};
try
{
await
this
.
exec
(
parentPath
,
[
'
clone
'
,
url
.
includes
(
'
'
)
?
encodeURI
(
url
)
:
url
,
folderPath
],
{
cancellationToke
n
});
await
this
.
exec
(
parentPath
,
[
'
clone
'
,
url
.
includes
(
'
'
)
?
encodeURI
(
url
)
:
url
,
folderPath
,
'
--progress
'
],
{
cancellationToken
,
onSpaw
n
});
}
catch
(
err
)
{
if
(
err
.
stderr
)
{
err
.
stderr
=
err
.
stderr
.
replace
(
/^Cloning.+$/m
,
''
).
trim
();
...
...
@@ -401,6 +432,10 @@ export class Git {
private
async
_exec
(
args
:
string
[],
options
:
SpawnOptions
=
{}):
Promise
<
IExecutionResult
<
string
>>
{
const
child
=
this
.
spawn
(
args
,
options
);
if
(
options
.
onSpawn
)
{
options
.
onSpawn
(
child
);
}
if
(
options
.
input
)
{
child
.
stdin
.
end
(
options
.
input
,
'
utf8
'
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录