title: No such file or directory error on commit hook
body: <p>This is my <code>pre-commit</code> hook</p>
  
  <pre><code>#!/bin/sh
  
  echo "pre-commit started"
  
  filename="$1"
  lineno=0
  
  error() {
      echo "$1"
      exit 1
  }
  
  while read -r line
  do
      [[ "$line" =~ ^#.* ]] &amp;&amp; continue
  
      let lineno+=1
      length=${#line}
  
      if [[ $lineno -eq 1 ]]; then
          [[ $length -gt 50 ]] &amp;&amp; error "Limit the subject line to 50 characters"
          [[ ! "$line" =~ ^[A-Z].*$ ]] &amp;&amp; error "Capitalise the subject line"
          [[ "$line" == *. ]] &amp;&amp; error "Do not end the subject line with a period"
      fi
  
      [[ $lineno -eq 2 ]] &amp;&amp; [[ -n $line ]] &amp;&amp; error "Separate subject from body with a blank line"
      [[ $lineno -gt 1 ]] &amp;&amp; [[ $length -gt 72 ]] &amp;&amp; error "Wrap the body at 72 characters"
  done &lt; "$filename"
  exit 0
  </code></pre>
  
  <p>I am getting this error while running </p>
  
  <pre><code>› git commit -m "sfrewr"
  pre-commit started
  /Users/me/.git-templates/hooks/pre-commit: line 28: : No such file or directory
  [master 6950a43] sfrewr
   1 file changed, 0 insertions(+), 0 deletions(-)
   create mode 100644 89
  </code></pre>
  
  <p>And line <code>28</code> reads </p>
  
  <pre><code>done &lt; "$filename"
  </code></pre>