Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e7e562da
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,发现更多精彩内容 >>
提交
e7e562da
编写于
11月 21, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove data uri from git
上级
8e1f429d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
51 deletion
+12
-51
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+12
-51
未找到文件。
extensions/git/src/commands.ts
浏览文件 @
e7e562da
...
...
@@ -295,10 +295,10 @@ export class CommandCenter {
}
}
else
{
if
(
resource
.
type
!==
Status
.
DELETED_BY_THEM
)
{
left
=
await
this
.
getLeftResource
(
resource
);
left
=
this
.
getLeftResource
(
resource
);
}
right
=
await
this
.
getRightResource
(
resource
);
right
=
this
.
getRightResource
(
resource
);
}
const
title
=
this
.
getTitle
(
resource
);
...
...
@@ -330,79 +330,40 @@ export class CommandCenter {
}
}
private
async
getURI
(
uri
:
Uri
,
ref
:
string
):
Promise
<
Uri
|
undefined
>
{
// const repository = this.model.getRepository(uri);
// if (!repository) {
return
toGitUri
(
uri
,
ref
);
// }
// try {
// let gitRef = ref;
// if (gitRef === '~') {
// const uriString = uri.toString();
// const [indexStatus] = repository.indexGroup.resourceStates.filter(r => r.resourceUri.toString() === uriString);
// gitRef = indexStatus ? '' : 'HEAD';
// }
// const { size, object } = await repository.getObjectDetails(gitRef, uri.fsPath);
// const { mimetype } = await repository.detectObjectType(object);
// if (mimetype === 'text/plain') {
// return toGitUri(uri, ref);
// }
// if (size > 1000000) { // 1 MB
// return Uri.parse(`data:;label:${path.basename(uri.fsPath)};description:${gitRef},`);
// }
// if (ImageMimetypes.indexOf(mimetype) > -1) {
// const contents = await repository.buffer(gitRef, uri.fsPath);
// return Uri.parse(`data:${mimetype};label:${path.basename(uri.fsPath)};description:${gitRef};size:${size};base64,${contents.toString('base64')}`);
// }
// return Uri.parse(`data:;label:${path.basename(uri.fsPath)};description:${gitRef},`);
// } catch (err) {
// return toGitUri(uri, ref);
// }
}
private
async
getLeftResource
(
resource
:
Resource
):
Promise
<
Uri
|
undefined
>
{
private
getLeftResource
(
resource
:
Resource
):
Uri
|
undefined
{
switch
(
resource
.
type
)
{
case
Status
.
INDEX_MODIFIED
:
case
Status
.
INDEX_RENAMED
:
case
Status
.
INDEX_ADDED
:
return
t
his
.
getURI
(
resource
.
original
,
'
HEAD
'
);
return
t
oGitUri
(
resource
.
original
,
'
HEAD
'
);
case
Status
.
MODIFIED
:
case
Status
.
UNTRACKED
:
return
t
his
.
getURI
(
resource
.
resourceUri
,
'
~
'
);
return
t
oGitUri
(
resource
.
resourceUri
,
'
~
'
);
case
Status
.
DELETED_BY_THEM
:
return
t
his
.
getURI
(
resource
.
resourceUri
,
''
);
return
t
oGitUri
(
resource
.
resourceUri
,
''
);
}
return
undefined
;
}
private
async
getRightResource
(
resource
:
Resource
):
Promise
<
Uri
|
undefined
>
{
private
getRightResource
(
resource
:
Resource
):
Uri
|
undefined
{
switch
(
resource
.
type
)
{
case
Status
.
INDEX_MODIFIED
:
case
Status
.
INDEX_ADDED
:
case
Status
.
INDEX_COPIED
:
case
Status
.
INDEX_RENAMED
:
return
t
his
.
getURI
(
resource
.
resourceUri
,
''
);
return
t
oGitUri
(
resource
.
resourceUri
,
''
);
case
Status
.
INDEX_DELETED
:
case
Status
.
DELETED
:
return
t
his
.
getURI
(
resource
.
resourceUri
,
'
HEAD
'
);
return
t
oGitUri
(
resource
.
resourceUri
,
'
HEAD
'
);
case
Status
.
DELETED_BY_US
:
return
t
his
.
getURI
(
resource
.
resourceUri
,
'
~3
'
);
return
t
oGitUri
(
resource
.
resourceUri
,
'
~3
'
);
case
Status
.
DELETED_BY_THEM
:
return
t
his
.
getURI
(
resource
.
resourceUri
,
'
~2
'
);
return
t
oGitUri
(
resource
.
resourceUri
,
'
~2
'
);
case
Status
.
MODIFIED
:
case
Status
.
UNTRACKED
:
...
...
@@ -771,7 +732,7 @@ export class CommandCenter {
return
;
}
const
HEAD
=
await
this
.
getLeftResource
(
resource
);
const
HEAD
=
this
.
getLeftResource
(
resource
);
const
basename
=
path
.
basename
(
resource
.
resourceUri
.
fsPath
);
const
title
=
`
${
basename
}
(HEAD)`
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录