Skip to content

Commit

Permalink
fix: filter out empty string for when there is no output
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Jan 28, 2020
1 parent 9a8c19b commit 7a6dc7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/gitWorkflow.js
Expand Up @@ -124,6 +124,7 @@ class GitWorkflow {
// - git stash can't infer RD or MD states correctly, and will lose the deletion
this.deletedFiles = (await this.execGit(['ls-files', '--deleted']))
.split('\n')
.filter(Boolean)
.map(file => path.resolve(this.gitDir, file))

// Save stash of entire original state, including unstaged and untracked changes.
Expand All @@ -137,6 +138,7 @@ class GitWorkflow {
// These files should be listed and deleted before proceeding.
const untrackedFiles = (await execGit(['ls-files', '--others', '--exclude-standard']))
.split('\n')
.filter(Boolean)
.map(file => path.resolve(this.gitDir, file))
await Promise.all(untrackedFiles.map(unlink))

Expand Down

0 comments on commit 7a6dc7a

Please sign in to comment.