I haven’t tried it but that patch seems to make sense to me, although I found another related issue so it might need tweaking. When running `git diff` in a repo owned by another user, the warning message says that this is not a git repository, instead of the warning shown by other git commands about "dubious ownership". To reproduce: sudo mkdir repo cd repo sudo git init git diff