]> git.openstreetmap.org Git - chef.git/blobdiff - hooks/pre-commit
Simplify loop index where arithmetic isn't needed.
[chef.git] / hooks / pre-commit
index 55d23300cee8c20ff844da2a421821cd7bd7da7b..57c23a35a1026fa3c805278c392fd36b2e3aff62 100755 (executable)
@@ -3,7 +3,7 @@
 ok = true
 
 if IO.popen(["git", "ls-files", "--unmerged"]).read.empty?
-  need_stash = IO.popen(%w(git diff)).read.length > 0
+  need_stash = !IO.popen(%w(git diff)).read.empty?
 
   system("git", "stash", "save", "--keep-index", "--quiet") if need_stash