Skip to content

Commit

Permalink
fix: unstage folder on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzent03 committed Oct 17, 2022
1 parent e690164 commit 56afe51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/simpleGit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ export class SimpleGit extends GitManager {
this.plugin.setState(PluginState.idle);
}

async unstageAll(): Promise<void> {
async unstageAll({ dir }: { dir?: string; }): Promise<void> {
this.plugin.setState(PluginState.add);
await this.git.reset([], (err) => this.onError(err));
await this.git.reset(dir != undefined ? ["--", dir] : [], (err) => this.onError(err));
this.plugin.setState(PluginState.idle);
}

Expand Down Expand Up @@ -222,7 +222,7 @@ export class SimpleGit extends GitManager {
} else if (this.plugin.settings.syncMethod === 'reset') {
try {
await this.git.raw(['update-ref', `refs/heads/${branchInfo.current}`, upstreamCommit], (err) => this.onError(err));
await this.unstageAll();
await this.unstageAll({});
} catch (err) {
this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${err.message}`);
}
Expand Down

0 comments on commit 56afe51

Please sign in to comment.