Change error for image_optim hook

The introduction of the stash-based pre-commit hook meant that any
changes made by hooks is blown away at the end of a hook run.

It would be nice if one could allow hooks to make changes to a file and
stage those changes along with what's already changed.

The problem with this is that the staged file in question might already
have other changes that have not been staged. This makes it a pain to
deal with conflicts in an automated way, and in fact `git` doesn't
provide a mechanism to do this cleanly (after much reading in the
`git-reset and git-checkout man pages, I'm pretty sure this can't be
done). Any solution requires human intervention to resolve the merge
conflicts, which isn't something we want to force the user to do.

Thus, we come to the conclusion that if we want to keep the stash-based
approach, we need to enforce that any changes made to the working tree
by hooks must be destroyed at the end of the hook run. This introduces
the pattern that hooks which make changes to files must report the
command they ran to users so users can make those changes themselves.

It's not great. Perhaps there is an alternative, but after some
significant investigation, a number of factors have lead to this
conclusion.

Change-Id: I6a5dc71a887bf0512548efc3017d234b7137b676
Reviewed-on: http://gerrit.causes.com/40354
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
Silence stderr in pre-commit HookContext spec

This command was displaying 'Cloning into test-sub' during spec runs.
Silence it.

Change-Id: I2d9be0f25eda8052c00a8f55cacdcce6f8a887fd
Reviewed-on: http://gerrit.causes.com/40355
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>