diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2021-12-23 20:29:49 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-23 21:28:34 +0100 |
commit | 0dd44584abf3fee0ba19b5edf856be2a79974228 (patch) | |
tree | f0ef0abeab44fac6db9743ca636710b52c9ae4d9 /reftable/writer.c | |
parent | reftable: fix typo in header (diff) | |
download | git-0dd44584abf3fee0ba19b5edf856be2a79974228.tar.xz git-0dd44584abf3fee0ba19b5edf856be2a79974228.zip |
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 '')
-rw-r--r-- | reftable/writer.c | 3 |
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; } |