Adds experimental 'Stash Changes' command

Adds experimental 'Stash Changes' to stash list
Adds experimental 'Stash Unstaged Changes' to stash list
This commit is contained in:
Eric Amodio
2017-03-29 01:31:31 -04:00
parent e3c9fd53ca
commit d8564c215c
11 changed files with 83 additions and 8 deletions

View File

@@ -250,6 +250,17 @@ export class Git {
return gitCommand(repoPath, ...defaultStashParams);
}
static stash_save(repoPath: string, message?: string, unstagedOnly: boolean = false) {
const params = [`stash`, `save`, `--include-untracked`];
if (unstagedOnly) {
params.push(`--keep-index`);
}
if (message) {
params.push(message);
}
return gitCommand(repoPath, ...params);
}
static status(repoPath: string, porcelainVersion: number = 1): Promise<string> {
const porcelain = porcelainVersion >= 2 ? `--porcelain=v${porcelainVersion}` : '--porcelain';
return gitCommand(repoPath, 'status', porcelain, '--branch');