Skip to content

Commit

Permalink
use FolderNode
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech authored and eamodio committed Jan 2, 2019
1 parent d314bb4 commit e6146c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/views/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export * from './nodes/commitFileNode';
export * from './nodes/commitNode';
export * from './nodes/fileHistoryNode';
export * from './nodes/fileHistoryTrackerNode';
export * from './nodes/folderNode';
export * from './nodes/lineHistoryNode';
export * from './nodes/lineHistoryTrackerNode';
export * from './nodes/remoteNode';
Expand Down
13 changes: 7 additions & 6 deletions src/views/viewCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
canDismissNode,
CommitFileNode,
CommitNode,
FolderNode,
RemoteNode,
RepositoryNode,
ResultsFileNode,
Expand Down Expand Up @@ -466,10 +467,10 @@ export class ViewCommands implements Disposable {
return;
}

private async stageDirectory(node: ViewNode) {
if (!node.uri.repoPath) return;
private async stageDirectory(node: FolderNode) {
if (!(node instanceof FolderNode) || !node.relativePath) return;

void (await Container.git.stageDirectory(node.uri.repoPath, node.uri));
void (await Container.git.stageDirectory(node.repoPath, node.relativePath));
}

private async stageFile(node: CommitFileNode | StatusFileNode) {
Expand All @@ -478,10 +479,10 @@ export class ViewCommands implements Disposable {
void (await Container.git.stageFile(node.repoPath, node.file.fileName));
}

private async unstageDirectory(node: ViewNode) {
if (!node.uri.repoPath) return;
private async unstageDirectory(node: FolderNode) {
if (!(node instanceof FolderNode) || !node.relativePath) return;

void (await Container.git.unStageDirectory(node.uri.repoPath, node.uri));
void (await Container.git.unStageDirectory(node.repoPath, node.relativePath));
}

private async unstageFile(node: CommitFileNode | StatusFileNode) {
Expand Down

0 comments on commit e6146c2

Please sign in to comment.