]> git.ipfire.org Git - thirdparty/git.git/commit
test-ref-store: tweaks to for-each-reflog-ent format
authorHan-Wen Nienhuys <hanwen@google.com>
Thu, 2 Dec 2021 17:36:32 +0000 (17:36 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Dec 2021 19:14:08 +0000 (11:14 -0800)
commit3474b602a5387df459a25c3e35747c11f1b08da7
treec3f35510edb7155f3ac9d8795a8cce654ebb9471
parent6887f69faa11141c20be29d2fd51bb33e15e227a
test-ref-store: tweaks to for-each-reflog-ent format

We have some tests that read from files in .git/logs/ hierarchy
when checking if correct reflog entries are created, but that is
too specific to the files backend.  Other backends like reftable
may not store its reflog entries in such a "one line per entry"
format.

Update for-each-reflog-ent test helper to produce output that
is identical to lines in a reflog file files backend uses.
That way, (1) the current tests can be updated to use the test
helper to read the reflog entries instead of (parts of) reflog
files, and perform the same inspection for correctness, and (2)
when the ref backend is swapped to another backend, the updated
test can be used as-is to check the correctness.

Adapt t1400 to use the for-each-reflog-ent test helper.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-ref-store.c
t/t1400-update-ref.sh