Re: [PATCH v9 00/10] Reftable support git-core
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 23, 2020, 21:43 UTC
- Message-ID
- <xmqqftctg9om.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAFQ2z_OhWDzc40WMy=bwUKRJQ4rcvnFmYvk-ga_cTtCjviMoBg@mail.gmail.com>
Han-Wen Nienhuys <hanwen@google.com> writes:
Show 13 quoted lines
> For example, > > not ok 10 - check rev-list > # > # echo $SHA >"$REAL/HEAD" && > # test "$SHA" = "$(git rev-list HEAD)" > # > > What is the right way to approach this? Should the test use > > git update-ref HEAD $SHA > > instead of writing to the loose ref?
Preferred.
I didn't bother checking the context, but if the test is checking "the history leading to $SHA has only one commit, i.e. $SHA, and rev-list can handle that correctly", certainly that would be a preferred rewrite, rather than skipping the check for reftable, which may risk not noticing that HEAD is broken with reftable.
Show 5 quoted lines
> Or should we skip it in case of > reftable? Similarly > > git update-ref $m $A && > test $A = $(cat .git/$m)
Ditto.
We have "git show-ref -s --verify" for that; "cat .git/$m" certainly is wrong.
Thanks.