Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-12-23 22:29:49 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-23 23:28:34 +0300
commit0dd44584abf3fee0ba19b5edf856be2a79974228 (patch)
treef0ef0abeab44fac6db9743ca636710b52c9ae4d9 /reftable/writer.c
parent019bd340820463b2ce2c006c45b6c87fefdd551c (diff)
reftable: signal overflow
reflog entries have unbounded size. In theory, each log ('g') block in reftable can have an arbitrary size, so the format allows for arbitrarily sized reflog messages. However, in the implementation, we are not scaling the log blocks up with the message, and writing a large message fails. This triggers a failure for reftable in t7006-pager.sh. Until this is fixed more structurally, report an error from within the reftable library for easier debugging. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/writer.c')
-rw-r--r--reftable/writer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/reftable/writer.c b/reftable/writer.c
index 3ca721e9f6..35c8649c9b 100644
--- a/reftable/writer.c
+++ b/reftable/writer.c
@@ -239,6 +239,9 @@ static int writer_add_record(struct reftable_writer *w,
writer_reinit_block_writer(w, reftable_record_type(rec));
err = block_writer_add(w->block_writer, rec);
if (err < 0) {
+ /* we are writing into memory, so an error can only mean it
+ * doesn't fit. */
+ err = REFTABLE_ENTRY_TOO_BIG_ERROR;
goto done;
}