From 7a6dc7ab1f250300a28d4480f2c22f02dd1bf246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iiro=20J=C3=A4ppinen?= Date: Tue, 28 Jan 2020 15:59:17 +0200 Subject: [PATCH] fix: filter out empty string for when there is no output --- lib/gitWorkflow.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/gitWorkflow.js b/lib/gitWorkflow.js index a55c1f624..749764cb0 100644 --- a/lib/gitWorkflow.js +++ b/lib/gitWorkflow.js @@ -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. @@ -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))