gitk: Run 'git rev-parse --git-dir' only once