mirror of
https://github.com/HackPlan/polaris-react.git
synced 2026-01-12 17:02:42 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user