]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack-check.c: remove the_repository references
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 10 Nov 2018 05:49:07 +0000 (06:49 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Nov 2018 05:50:06 +0000 (14:50 +0900)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c
pack-check.c
pack.h

index 06eb42172099a39e6f181d0dd7eab581595d9756..8ea2823864f7071ec835beec90eb6025a20eaf64 100644 (file)
@@ -752,7 +752,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
                        for (p = get_all_packs(the_repository); p;
                             p = p->next) {
                                /* verify gives error messages itself */
-                               if (verify_pack(p, fsck_obj_buffer,
+                               if (verify_pack(the_repository,
+                                               p, fsck_obj_buffer,
                                                progress, count))
                                        errors_found |= ERROR_PACK;
                                count += p->num_objects;
index fa5f0ff8fa57461486ab2f82e58ad3eeffab77f1..2cc3603189b8cd27781fd16cba2eb10a16817038 100644 (file)
@@ -48,7 +48,8 @@ int check_pack_crc(struct packed_git *p, struct pack_window **w_curs,
        return data_crc != ntohl(*index_crc);
 }
 
-static int verify_packfile(struct packed_git *p,
+static int verify_packfile(struct repository *r,
+                          struct packed_git *p,
                           struct pack_window **w_curs,
                           verify_fn fn,
                           struct progress *progress, uint32_t base_count)
@@ -135,7 +136,7 @@ static int verify_packfile(struct packed_git *p,
                        data = NULL;
                        data_valid = 0;
                } else {
-                       data = unpack_entry(the_repository, p, entries[i].offset, &type, &size);
+                       data = unpack_entry(r, p, entries[i].offset, &type, &size);
                        data_valid = 1;
                }
 
@@ -186,7 +187,7 @@ int verify_pack_index(struct packed_git *p)
        return err;
 }
 
-int verify_pack(struct packed_git *p, verify_fn fn,
+int verify_pack(struct repository *r, struct packed_git *p, verify_fn fn,
                struct progress *progress, uint32_t base_count)
 {
        int err = 0;
@@ -196,7 +197,7 @@ int verify_pack(struct packed_git *p, verify_fn fn,
        if (!p->index_data)
                return -1;
 
-       err |= verify_packfile(p, &w_curs, fn, progress, base_count);
+       err |= verify_packfile(r, p, &w_curs, fn, progress, base_count);
        unuse_pack(&w_curs);
 
        return err;
diff --git a/pack.h b/pack.h
index 34a9d458b411927b7c1e121e88387e022841ea2a..da99fdd1d2baf7574b606f4c2bc6e1dcfeacf0fa 100644 (file)
--- a/pack.h
+++ b/pack.h
@@ -4,6 +4,8 @@
 #include "object.h"
 #include "csum-file.h"
 
+struct repository;
+
 /*
  * Packed object header
  */
@@ -80,7 +82,7 @@ typedef int (*verify_fn)(const struct object_id *, enum object_type, unsigned lo
 extern const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects, int nr_objects, const struct pack_idx_option *, const unsigned char *sha1);
 extern int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr);
 extern int verify_pack_index(struct packed_git *);
-extern int verify_pack(struct packed_git *, verify_fn fn, struct progress *, uint32_t);
+extern int verify_pack(struct repository *, struct packed_git *, verify_fn fn, struct progress *, uint32_t);
 extern off_t write_pack_header(struct hashfile *f, uint32_t);
 extern void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t);
 extern char *index_pack_lockfile(int fd);