(shell-command)
does use the the buffer's default-directory
, which means there is no reason to cd
to the buffer's directory.
The problem in my case was that I was mistakenly running git gui
on a buffer that didn't have an associated .git/
directory.