Skip to content

Commit

Permalink
Make pre-commit hook pass if playground is not staged
Browse files Browse the repository at this point in the history
Previously the pre-commit hook stopped you commiting if you had any
changes in the playground even if those changes weren't staged for
commit. This meant you had to totally reset your playground even if you
weren't about to commit it.

Now we check if the playground is staged for commit, so if the
playground is modified but not staged for commit you can still commit
your other changes
  • Loading branch information
BPScott committed Sep 20, 2018
1 parent 206a18b commit b2030a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module PreCommit
end

def changed_files
@changed_files ||= %x(git diff-index --abbrev --name-only HEAD).lines.map(&:chomp)
@changed_files ||= %x(git diff --cached --name-only HEAD).lines.map(&:chomp)
end
end

Expand Down

0 comments on commit b2030a6

Please sign in to comment.