Make pre-commit hook pass if playground is not staged

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
This commit is contained in:
Ben Scott
2018-09-19 18:11:26 -07:00
parent 206a18b215
commit b2030a67cc

View File

@@ -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