Error:

Change author's email and name in commit history

#!/bin/sh
FROM_AUTHOR=user@oldcompany.com
TO_AUTHOR=user@newcompany.com
TO_NAME='John Doe'

git filter-branch --commit-filter "
  if [ \"\$GIT_COMMITTER_EMAIL\" = \"$FROM_AUTHOR\" ]; then
    GIT_COMMITTER_NAME=\"$TO_NAME\";
    GIT_COMMITTER_EMAIL=\"$TO_AUTHOR\";
    GIT_AUTHOR_NAME=\"$TO_NAME\";
    GIT_AUTHOR_EMAIL=\"$TO_AUTHOR\";
    git commit-tree \"\$@\";
  else
    git commit-tree \"\$@\";
  fi" HEAD