Fix indentation
Capture external hooks output

Since we didn't care about external hooks's output, their STDOUT and
STDERR were simply going to the default stream. This is OK for standard
Git hooks but not for Gerrit hooks, because the output ended up only on
Gerrit's error log in the server.

Now we redirect STDOUT and STDERR to a temporary file before invoking
external hooks and capture anything left there later so that we can send
it to the normal output and also insert it in any Gerrit comment we
generate along with error messages.
Substitute filter_files_in_* for get_diff_files

The method Git::Hooks::get_diff_files returned a hash mapping filenames
to change statuses. It was being used so far only in the CheckStructure
plugin. There were two problems with it.

First, it was unecessarily complicated because it returned a hash and
only the filenames were being used. So, it would be simpler to return a
list of file names.

Second, it wasn't general enough. As it were, it could only grok the
list of files changed between two commits, which we use in the update
and the pre-receive hook. However, the pre-commit hook needs to grok
changes in the index, and Gerrit's patchset-created hook needs to grok
changes in a single commit.

So, in this commit I remove the get_diff_files method and substituted
for it three new ones:

- filter_files_in_index: returns the files changed in the index with
  respect to HEAD.

- filter_files_in_range: returns the files changed between two commits.

- filter_files_in_commit: returns the files changed in a single commit
  with respect to its parents.

All three return lists of file names.
Implement Git::Hooks::file_temp

This routine returns a File::Temp object representing a temporary file
into which the contents of the file FILE in revision REV has been
copied. It's useful for hooks that need to read the contents of changed
files in order to check anything in them.
Reset $ENV{HOME} during tests

Do this to avoid depending on ~/.gitconfig.
Implement new plugin CheckFile

While CheckStructure checks the names of files and references, CheckFile
checks the file's contents.