Thread (3 messages) 3 messages, 3 authors, 2025-09-10

Re: [PATCH] odb: drop deprecated wrapper functions

From: Jeff King <hidden>
Date: 2025-09-10 15:38:04
Subsystem: the rest · Maintainer: Linus Torvalds

On Wed, Sep 10, 2025 at 03:12:17PM +0200, Patrick Steinhardt wrote:
quoted hunk ↗ jump to hunk
diff --git a/odb.h b/odb.h
index 3dfc66d75a..e8b9dff948 100644
--- a/odb.h
+++ b/odb.h
@@ -475,37 +475,4 @@ static inline int odb_write_object(struct object_database *odb,
 	return odb_write_object_ext(odb, buf, len, type, oid, NULL, 0);
 }
 
-/* Compatibility wrappers, to be removed once Git 2.51 has been released. */
-#include "repository.h"
When merged to 'jch', this patch breaks the build. The issue is that
code added by ps/packfile-store was subtly depending on this include to
have access to the definition of "struct repository":

  pack-objects.c: In function ‘prepare_in_pack_by_idx’:
  pack-objects.c:89:51: error: invalid use of undefined type ‘struct repository’
     89 |         struct packfile_store *packs = pdata->repo->objects->packfiles;
        |                                                   ^~

The fix is probably just:
diff --git a/pack-objects.c b/pack-objects.c
index 668c113667..5b70aa400e 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -4,6 +4,7 @@
 #include "pack-objects.h"
 #include "packfile.h"
 #include "parse.h"
+#include "repository.h"
 
 static uint32_t locate_object_entry_hash(struct packing_data *pdata,
 					 const struct object_id *oid,
either in the merge, or possibly in that other topic as a preparatory
step (I didn't look at how close it is to graduating to 'next').

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help