feat: restore working base branch and uncommitted changes

This commit is contained in:
Peter Evans 2022-11-29 15:56:08 +09:00
parent 1847e5d1d6
commit 27a3a9910c
5 changed files with 216 additions and 15 deletions

View file

@ -210,6 +210,23 @@ export class GitCommandManager {
return output.stdout.trim()
}
async stashPush(options?: string[]): Promise<boolean> {
const args = ['stash', 'push']
if (options) {
args.push(...options)
}
const output = await this.exec(args)
return output.stdout.trim() !== 'No local changes to save'
}
async stashPop(options?: string[]): Promise<void> {
const args = ['stash', 'pop']
if (options) {
args.push(...options)
}
await this.exec(args)
}
async status(options?: string[]): Promise<string> {
const args = ['status']
if (options) {