Re: bugreport: "git config --global" fails if an invalid .git file present
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 18, 2022, 16:28 UTC
- Message-ID
- <xmqq35dtseht.fsf@gitster.g>
- In-Reply-To
- <Yv3ZKcD0L0dSIavr@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> And that would make your case Just Work. But it's also more dangerous; > if a misconfiguration or transient error caused us to set up an > unexpected environment, then the results could be quite wrong and > confusing. Maybe less so for "git config", but for destructive > operations it's a scarier concept.
That is a good point, especially if destructive command is run in a repository the user didn't mean to run it in, it would not be pretty.
> In your case, the right resolution is probably to delete the bogus .git > file.
Yup, that was what I said in a draft I wrote a few days ago and still in my outbox ;-)