git-commit-filetree: remove duplicate code; slight re-organization.
git-commit-filetree: remove duplicate code; slight re-organization.

* Give err() a return status param, and use it for all error returns.
* Return error status 255 for any internal error.
* Move some code around for clarity.
* Indicate why we export GIT_INDEX_FILE where we do.

cjs-cynic-net/git-commit-filetree,cjs-cynic-net/git-commit-filetree,cjs-cynic-net/git-commit-filetree