Skip to content

Commit

Permalink
new branch
Browse files Browse the repository at this point in the history
  • Loading branch information
OneThatWalks committed Aug 6, 2019
1 parent c223ba6 commit b93c4fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions extensions/git/src/commands.ts
Expand Up @@ -353,6 +353,8 @@ export class CommandCenter {
switch (resource.type) {
case Status.INDEX_MODIFIED:
case Status.INDEX_RENAMED:
case Status.UNTRACKED:
case Status.INDEX_ADDED:
return this.getURI(resource.original, 'HEAD');

case Status.MODIFIED:
Expand Down Expand Up @@ -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:
Expand All @@ -426,6 +429,10 @@ export class CommandCenter {

case Status.DELETED_BY_THEM:
return `${basename} (Ours)`;

case Status.UNTRACKED:

return `${basename} (Untracked)`;
}

return '';
Expand Down
4 changes: 3 additions & 1 deletion extensions/git/src/git.ts
Expand Up @@ -1116,15 +1116,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> {
Expand Down

0 comments on commit b93c4fa

Please sign in to comment.