Re: Be more careful about updating refs
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jan 16, 2008, 00:02 UTC
- Message-ID
- <alpine.LFD.1.00.0801151600140.2806@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LFD.1.00.0801151546560.2806@woody.linux-foundation.org>
On Tue, 15 Jan 2008, Linus Torvalds wrote:
> > This makes write_ref_sha1() more careful: it actually checks the SHA1 of > the ref it is updating, and refuses to update a ref with an object that it > cannot find.
Side note: this breaks some tests, because those tests do things like
git update-ref refs/heads/master 1111111111111111111111111111111111111111 && test 1111111111111111111111111111111111111111 = $(cat .git/refs/heads/master)
which obviously won't work. I didn't update the tests, because I'm an evil person who just finds it very onerous to touch tests, and I particularly hate tests that turn out to be wrong.
(Pet peeve on mine: people fixing assert()'s by changing the source-code, without ever asking themselves whether maybe the assert itself was the bug).
Linus