git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/6] ref-filter: add check for negative file size

From
Olga Telezhnaya <olyatelezhnaya@gmail.com>
Date
Dec 24, 2018, 13:24 UTC
Message-ID
<01020167e06368cb-7c85a9f8-c94c-47a6-9068-929e11104cec-000000@eu-west-1.amazonses.com>
In-Reply-To
<01020167e063687c-37a43a09-0a5f-4335-8c21-ec15a0a67882-000000@eu-west-1.amazonses.com>
If we have negative file size, we are doing something wrong.
Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
---
 ref-filter.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/ref-filter.c b/ref-filter.c
index fd95547676047..45c558bcbd521 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1491,6 +1491,8 @@ static int get_object(struct ref_array_item *ref, int deref, struct object **obj
 				     OBJECT_INFO_LOOKUP_REPLACE))
 		return strbuf_addf_ret(err, -1, _("missing object %s for %s"),
 				       oid_to_hex(&oi->oid), ref->refname);
+	if (oi->info.disk_sizep && oi->disk_size < 0)
+		BUG("Object size is less than zero.");
 
 	if (oi->info.contentp) {
 		*obj = parse_object_buffer(the_repository, &oi->oid, oi->type, oi->size, oi->content, &eaten);

--
https://github.com/git/git/pull/552
Previous: Olga TelezhnayaNext: Junio C Hamano
Message 6 of 7 in “ref-filter: add objectsize:disk option”
  1. 1/6 ref-filter: add objectsize:disk optionOlga Telezhnaya, Dec 24, 2018
  2. 6/6 ref-filter: add docs for new optionsOlga Telezhnaya, Dec 24, 2018
  3. 4/6 ref-filter: add deltabase optionOlga Telezhnaya, Dec 24, 2018
  4. 3/6 ref-filter: add tests for objectsize:diskOlga Telezhnaya, Dec 24, 2018
  5. 5/6 ref-filter: add tests for deltabaseOlga Telezhnaya, Dec 24, 2018
  6. 2/6 ref-filter: add check for negative file sizeOlga Telezhnaya, Dec 24, 2018
  7. Junio C HamanoDec 26, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.