git-codereview: work around git checkout-index bug in gofmt

If you run 'git gofmt' when files in the working directory differ from
modified files in the index and you are running the command not
from that working directory or a parent, then git checkout-index --temp
(used by git gofmt) will print mangled path names, confusing git gofmt.
The most common error this causes is:

	git-codereview: gofmt reported errors:
		stat : no such file or directory

although there are other possible ways it can fail.

I've reported the git bug, which will be fixed in Git 2.3.0.
Work around the bug by always invoking git checkout-index in the
repo root.

Fixes #9476.

Change-Id: Ifcbdfd4a966dd21518dd95ceacd81a1679048e3c
Reviewed-by: Alex Brainman <>
Reviewed-by: Andrew Gerrand <>
3 files changed
tree: f17b34629b176ca9922188aab41444a79021d3c9
  1. .gitattributes
  3. git-codereview/