git-update-dirs: chdir('..') if we're inside a .git directory

Some commands that need a work tree don't work there, for example git
pull.

09c76cca-cb51-11e3-a3d3-000df06acc56
0bdf44ca-cb5a-11e3-9095-fefdb24f8e10