* bootstrap.conf: Add if clause before cmp(1) call.
---
 bootstrap.conf | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 4e0b388..072e74d 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -109,9 +109,11 @@ bootstrap_epilogue()
   if test $backup = 1; then
     hooks=$(cd scripts/git-hooks && git ls-files)
     for f in $hooks; do
-      # If it is identical, skip it.
-      cmp scripts/git-hooks/$f .git/hooks/$f > /dev/null \
-       && continue
+      if [ -f .git/hooks/$f ]; then
+       # If it is identical, skip it.
+       cmp scripts/git-hooks/$f .git/hooks/$f > /dev/null \
+         && continue
+      fi
       cp --backup=numbered scripts/git-hooks/$f .git/hooks
       chmod a-w .git/hooks/$f
     done
-- 
2.2.1


Reply via email to