From b2030a67cce54f6cf23e446c69d7486a1e416ac4 Mon Sep 17 00:00:00 2001 From: Ben Scott Date: Wed, 19 Sep 2018 18:11:26 -0700 Subject: [PATCH] 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 --- pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre-commit b/pre-commit index 6b6089e22f1..fda17a3e579 100755 --- a/pre-commit +++ b/pre-commit @@ -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