Re: git diff prints long usage help if not run in git repo
- From
- Mohamed Akram <mohd.akram@outlook.com>
- Date
- Aug 23, 2022, 20:03 UTC
- Message-ID
- <A01F00AA-B96E-40EF-9017-9005A8AC1E14@outlook.com>
- In-Reply-To
- <xmqq5yikcbd1.fsf@gitster.g>
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