Make variable names consistent, and fix confusion between workdir and gitdir.

Signed-off-by: Daira Hopwood <daira@leastauthority.com>