Replace (eq _ 0) with (zerop _).
Keep track of git-dir; add debugging messages.