packfile.h: move pack_window and pack_entry from cache.h

Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Apr 22, 2023 at 20:17 UTC 0ff73d742b40bc85966d5b7dcc28f438910f771c
3 files changed +15 -16
cache.h
-14
@@ -593,20 +593,6 @@ int df_name_compare(const char *name1, size_t len1, int mode1,
593 int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
594 int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
595
596 -struct pack_window {
597 - struct pack_window *next;
598 - unsigned char *base;
599 - off_t offset;
600 - size_t len;
601 - unsigned int last_used;
602 - unsigned int inuse_cnt;
603 -};
604 -
605 -struct pack_entry {
606 - off_t offset;
607 - struct packed_git *p;
608 -};
609 -
596 /* Dumb servers support */
597 int update_server_info(int);
598
packfile.h
+14 -2
@@ -6,10 +6,22 @@
6
7 /* in object-store.h */
8 struct packed_git;
9 -struct pack_entry;
10 -struct pack_window;
9 struct object_info;
10
11 +struct pack_window {
12 + struct pack_window *next;
13 + unsigned char *base;
14 + off_t offset;
15 + size_t len;
16 + unsigned int last_used;
17 + unsigned int inuse_cnt;
18 +};
19 +
20 +struct pack_entry {
21 + off_t offset;
22 + struct packed_git *p;
23 +};
24 +
25 /*
26 * Generate the filename to be used for a pack file with checksum "sha1" and
27 * extension "ext". The result is written into the strbuf "buf", overwriting
t/helper/test-read-midx.c
+1
@@ -5,6 +5,7 @@
5 #include "repository.h"
6 #include "object-store.h"
7 #include "pack-bitmap.h"
8 +#include "packfile.h"
9 #include "setup.h"
10
11 static int read_midx_file(const char *object_dir, int show_objects)