Skip to content

Commit

Permalink
fix: resolve relative paths to staged files
Browse files Browse the repository at this point in the history
This fixes instances where there are staged changes, but they aren't
picked up with using the `--staged` flag.

After moving to gathering files with absolute paths, we must construct
absolute paths for the files reported as changed by Git that were listed
as relative.
  • Loading branch information
varl committed Oct 28, 2020
1 parent 49a03d7 commit db142b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ const stagedFiles = (files = []) => {
const output = result.stdout.trim()

if (output) {
const staged = output.split('\n')
const staged = output
.split('\n')
.map(f => path.resolve(CONSUMING_ROOT, f))

return files.filter(f => staged.includes(f))
}

Expand Down

0 comments on commit db142b6

Please sign in to comment.