From 3466903c8940d5bcbf12e17ac27e65f66e990d3b Mon Sep 17 00:00:00 2001 From: Bunyanuch Saengnet <53788417+bunysae@users.noreply.github.com> Date: Mon, 21 Dec 2020 06:23:16 +0100 Subject: [PATCH] Handle long path names in the "show files added since last release" feature (#579) Co-authored-by: Sindre Sorhus --- source/git-util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/git-util.js b/source/git-util.js index 0ed63395..e3bd672d 100644 --- a/source/git-util.js +++ b/source/git-util.js @@ -12,8 +12,8 @@ exports.latestTag = async () => { exports.newFilesSinceLastRelease = async () => { try { - const {stdout} = await execa('git', ['diff', '--stat', '--diff-filter=A', await this.latestTag(), 'HEAD']); - const result = stdout.trim().split('\n').slice(0, -1).map(row => row.slice(0, row.indexOf('|')).trim()); + const {stdout} = await execa('git', ['diff', '--name-only', '--diff-filter=A', await this.latestTag(), 'HEAD']); + const result = stdout.trim().split('\n').map(row => row.trim()); return result; } catch { // Get all files under version control