提交 28bcf282 编写于 作者: J Joao Moreno

Merge commit 'refs/pull/78562/head' of github.com:microsoft/vscode into pr/78562

......@@ -353,9 +353,11 @@ export class CommandCenter {
switch (resource.type) {
case Status.INDEX_MODIFIED:
case Status.INDEX_RENAMED:
case Status.INDEX_ADDED:
return this.getURI(resource.original, 'HEAD');
case Status.MODIFIED:
case Status.UNTRACKED:
return this.getURI(resource.resourceUri, '~');
case Status.DELETED_BY_THEM:
......@@ -414,6 +416,7 @@ export class CommandCenter {
switch (resource.type) {
case Status.INDEX_MODIFIED:
case Status.INDEX_RENAMED:
case Status.INDEX_ADDED:
return `${basename} (Index)`;
case Status.MODIFIED:
......@@ -426,6 +429,10 @@ export class CommandCenter {
case Status.DELETED_BY_THEM:
return `${basename} (Ours)`;
case Status.UNTRACKED:
return `${basename} (Untracked)`;
}
return '';
......
......@@ -1128,15 +1128,17 @@ export class Repository {
}
let mode: string;
let add: string = '';
try {
const details = await this.getObjectDetails('HEAD', path);
mode = details.mode;
} catch (err) {
mode = '100644';
add = '--add';
}
await this.run(['update-index', '--cacheinfo', mode, hash, path]);
await this.run(['update-index', add, '--cacheinfo', mode, hash, path]);
}
async checkout(treeish: string, paths: string[], opts: { track?: boolean } = Object.create(null)): Promise<void> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册