Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ca58c21b
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,发现更多精彩内容 >>
提交
ca58c21b
编写于
2月 22, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #44188
上级
03f92dde
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
16 addition
and
26 deletion
+16
-26
extensions/git/src/api.ts
extensions/git/src/api.ts
+1
-1
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+3
-10
extensions/git/src/decorationProvider.ts
extensions/git/src/decorationProvider.ts
+2
-2
extensions/git/src/decorators.ts
extensions/git/src/decorators.ts
+1
-1
extensions/git/src/git.ts
extensions/git/src/git.ts
+0
-2
extensions/git/src/main.ts
extensions/git/src/main.ts
+1
-1
extensions/git/src/model.ts
extensions/git/src/model.ts
+2
-2
extensions/git/src/repository.ts
extensions/git/src/repository.ts
+4
-6
extensions/git/tsconfig.json
extensions/git/tsconfig.json
+2
-1
未找到文件。
extensions/git/src/api.ts
浏览文件 @
ca58c21b
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
{
Model
}
from
'
./model
'
;
import
{
SourceControlInputBox
,
Uri
}
from
'
vscode
'
;
import
{
Uri
}
from
'
vscode
'
;
export
interface
InputBox
{
value
:
string
;
...
...
extensions/git/src/commands.ts
浏览文件 @
ca58c21b
...
...
@@ -7,10 +7,10 @@
import
{
Uri
,
commands
,
Disposable
,
window
,
workspace
,
QuickPickItem
,
OutputChannel
,
Range
,
WorkspaceEdit
,
Position
,
LineChange
,
SourceControlResourceState
,
TextDocumentShowOptions
,
ViewColumn
,
ProgressLocation
,
TextEditor
,
CancellationTokenSource
,
StatusBarAlignment
}
from
'
vscode
'
;
import
{
Ref
,
RefType
,
Git
,
GitErrorCodes
,
Branch
}
from
'
./git
'
;
import
{
Repository
,
Resource
,
Status
,
CommitOptions
,
ResourceGroupType
,
RepositoryState
}
from
'
./repository
'
;
import
{
Repository
,
Resource
,
Status
,
CommitOptions
,
ResourceGroupType
}
from
'
./repository
'
;
import
{
Model
}
from
'
./model
'
;
import
{
toGitUri
,
fromGitUri
}
from
'
./uri
'
;
import
{
grep
,
eventToPromise
,
isDescendant
}
from
'
./util
'
;
import
{
grep
,
isDescendant
}
from
'
./util
'
;
import
{
applyLineChanges
,
intersectDiffWithRange
,
toLineRanges
,
invertLineChange
,
getModifiedRange
}
from
'
./staging
'
;
import
*
as
path
from
'
path
'
;
import
{
lstat
,
Stats
}
from
'
fs
'
;
...
...
@@ -237,7 +237,7 @@ export class CommandCenter {
}
const
{
size
,
object
}
=
await
repository
.
lstree
(
gitRef
,
uri
.
fsPath
);
const
{
mimetype
,
encoding
}
=
await
repository
.
detectObjectType
(
object
);
const
{
mimetype
}
=
await
repository
.
detectObjectType
(
object
);
if
(
mimetype
===
'
text/plain
'
)
{
return
toGitUri
(
uri
,
ref
);
...
...
@@ -1051,13 +1051,6 @@ export class CommandCenter {
value
=
(
await
repository
.
getCommit
(
repository
.
HEAD
.
commit
)).
message
;
}
const
getPreviousCommitMessage
=
async
()
=>
{
//Only return the previous commit message if it's an amend commit and the repo already has a commit
if
(
opts
&&
opts
.
amend
&&
repository
.
HEAD
&&
repository
.
HEAD
.
commit
)
{
return
(
await
repository
.
getCommit
(
'
HEAD
'
)).
message
;
}
};
return
await
window
.
showInputBox
({
value
,
placeHolder
:
localize
(
'
commit message
'
,
"
Commit message
"
),
...
...
extensions/git/src/decorationProvider.ts
浏览文件 @
ca58c21b
...
...
@@ -10,8 +10,8 @@ import * as path from 'path';
import
{
Repository
,
GitResourceGroup
,
Status
}
from
'
./repository
'
;
import
{
Model
}
from
'
./model
'
;
import
{
debounce
}
from
'
./decorators
'
;
import
{
filterEvent
,
dispose
,
anyEvent
,
mapEvent
,
fireEvent
}
from
'
./util
'
;
import
{
Submodule
,
GitErrorCodes
}
from
'
./git
'
;
import
{
filterEvent
,
dispose
,
anyEvent
,
fireEvent
}
from
'
./util
'
;
import
{
GitErrorCodes
}
from
'
./git
'
;
type
Callback
=
{
resolve
:
(
status
:
boolean
)
=>
void
,
reject
:
(
err
:
any
)
=>
void
};
...
...
extensions/git/src/decorators.ts
浏览文件 @
ca58c21b
...
...
@@ -78,7 +78,7 @@ function _throttle<T>(fn: Function, key: string): Function {
export
const
throttle
=
decorate
(
_throttle
);
function
_sequentialize
<
T
>
(
fn
:
Function
,
key
:
string
):
Function
{
function
_sequentialize
(
fn
:
Function
,
key
:
string
):
Function
{
const
currentKey
=
`__$sequence$
${
key
}
`
;
return
function
(
this
:
any
,
...
args
:
any
[])
{
...
...
extensions/git/src/git.ts
浏览文件 @
ca58c21b
...
...
@@ -362,7 +362,6 @@ function getGitErrorCode(stderr: string): string | undefined {
export
class
Git
{
private
gitPath
:
string
;
private
version
:
string
;
private
env
:
any
;
private
_onOutput
=
new
EventEmitter
();
...
...
@@ -370,7 +369,6 @@ export class Git {
constructor
(
options
:
IGitOptions
)
{
this
.
gitPath
=
options
.
gitPath
;
this
.
version
=
options
.
version
;
this
.
env
=
options
.
env
||
{};
}
...
...
extensions/git/src/main.ts
浏览文件 @
ca58c21b
...
...
@@ -14,7 +14,7 @@ import { CommandCenter } from './commands';
import
{
GitContentProvider
}
from
'
./contentProvider
'
;
import
{
GitDecorations
}
from
'
./decorationProvider
'
;
import
{
Askpass
}
from
'
./askpass
'
;
import
{
toDisposable
,
filterEvent
,
mapEvent
,
eventToPromise
}
from
'
./util
'
;
import
{
toDisposable
,
filterEvent
,
eventToPromise
}
from
'
./util
'
;
import
TelemetryReporter
from
'
vscode-extension-telemetry
'
;
import
{
API
,
createApi
}
from
'
./api
'
;
...
...
extensions/git/src/model.ts
浏览文件 @
ca58c21b
...
...
@@ -5,10 +5,10 @@
'
use strict
'
;
import
{
workspace
,
WorkspaceFoldersChangeEvent
,
Uri
,
window
,
Event
,
EventEmitter
,
QuickPickItem
,
Disposable
,
SourceControl
,
SourceControlResourceGroup
,
TextEditor
,
Memento
,
ConfigurationChangeEvent
}
from
'
vscode
'
;
import
{
workspace
,
WorkspaceFoldersChangeEvent
,
Uri
,
window
,
Event
,
EventEmitter
,
QuickPickItem
,
Disposable
,
SourceControl
,
SourceControlResourceGroup
,
TextEditor
,
Memento
}
from
'
vscode
'
;
import
{
Repository
,
RepositoryState
}
from
'
./repository
'
;
import
{
memoize
,
sequentialize
,
debounce
}
from
'
./decorators
'
;
import
{
dispose
,
anyEvent
,
filterEvent
,
IDisposable
,
isDescendant
,
find
,
firstIndex
}
from
'
./util
'
;
import
{
dispose
,
anyEvent
,
filterEvent
,
isDescendant
,
firstIndex
}
from
'
./util
'
;
import
{
Git
,
GitErrorCodes
}
from
'
./git
'
;
import
*
as
path
from
'
path
'
;
import
*
as
fs
from
'
fs
'
;
...
...
extensions/git/src/repository.ts
浏览文件 @
ca58c21b
...
...
@@ -398,7 +398,7 @@ class ProgressManager {
private
disposable
:
IDisposable
=
EmptyDisposable
;
constructor
(
private
repository
:
Repository
)
{
constructor
(
repository
:
Repository
)
{
const
start
=
onceEvent
(
filterEvent
(
repository
.
onDidChangeOperations
,
()
=>
repository
.
operations
.
shouldShowProgress
()));
const
end
=
onceEvent
(
filterEvent
(
debounceEvent
(
repository
.
onDidChangeOperations
,
300
),
()
=>
!
repository
.
operations
.
shouldShowProgress
()));
...
...
@@ -790,8 +790,8 @@ export class Repository implements Disposable {
async
buffer
(
ref
:
string
,
filePath
:
string
):
Promise
<
Buffer
>
{
return
await
this
.
run
(
Operation
.
Show
,
async
()
=>
{
const
relativePath
=
path
.
relative
(
this
.
repository
.
root
,
filePath
).
replace
(
/
\\
/g
,
'
/
'
);
const
configFiles
=
workspace
.
getConfiguration
(
'
files
'
,
Uri
.
file
(
filePath
));
const
encoding
=
configFiles
.
get
<
string
>
(
'
encoding
'
);
//
const configFiles = workspace.getConfiguration('files', Uri.file(filePath));
//
const encoding = configFiles.get<string>('encoding');
// TODO@joao: REsource config api
return
await
this
.
repository
.
buffer
(
`
${
ref
}
:
${
relativePath
}
`
);
...
...
@@ -1009,10 +1009,8 @@ export class Repository implements Disposable {
case
'
UU
'
:
return
merge
.
push
(
new
Resource
(
ResourceGroupType
.
Merge
,
uri
,
Status
.
BOTH_MODIFIED
,
useIcons
));
}
let
isModifiedInIndex
=
false
;
switch
(
raw
.
x
)
{
case
'
M
'
:
index
.
push
(
new
Resource
(
ResourceGroupType
.
Index
,
uri
,
Status
.
INDEX_MODIFIED
,
useIcons
));
isModifiedInIndex
=
true
;
break
;
case
'
M
'
:
index
.
push
(
new
Resource
(
ResourceGroupType
.
Index
,
uri
,
Status
.
INDEX_MODIFIED
,
useIcons
));
break
;
case
'
A
'
:
index
.
push
(
new
Resource
(
ResourceGroupType
.
Index
,
uri
,
Status
.
INDEX_ADDED
,
useIcons
));
break
;
case
'
D
'
:
index
.
push
(
new
Resource
(
ResourceGroupType
.
Index
,
uri
,
Status
.
INDEX_DELETED
,
useIcons
));
break
;
case
'
R
'
:
index
.
push
(
new
Resource
(
ResourceGroupType
.
Index
,
uri
,
Status
.
INDEX_RENAMED
,
useIcons
,
renameUri
));
break
;
...
...
extensions/git/tsconfig.json
浏览文件 @
ca58c21b
...
...
@@ -10,7 +10,8 @@
"./node_modules/@types"
],
"strict"
:
true
,
"experimentalDecorators"
:
true
"experimentalDecorators"
:
true
,
"noUnusedLocals"
:
true
},
"include"
:
[
"src/**/*"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录