@matheusbsbs / matheus-bagliano / commits / c2c5b27051
Fork 0

sha1_file: make "read_object" static

This function is only used from "sha1_file.c". And as we want to add a "replace_object" hook in "read_sha1_file", we must not let people bypass the hook using something other than "read_sha1_file". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Jan 12, 2009 at 18:42 UTC c2c5b27051babdc2a7503d5b9d695b4c7b45c14b
2 files changed +5 -5
cache.h
-3
@@ -631,9 +631,6 @@ extern int write_sha1_file(void *buf, unsigned long len, const char *type, unsig
631 extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
632 extern int force_object_loose(const unsigned char *sha1, time_t mtime);
633
634 -/* just like read_sha1_file(), but non fatal in presence of bad objects */
635 -extern void *read_object(const unsigned char *sha1, enum object_type *type, unsigned long *size);
636 -
634 /* global flag to enable extra checks when accessing packed objects */
635 extern int do_check_packed_object_crc;
636
sha1_file.c
+5 -2
@@ -1700,6 +1700,9 @@ static void add_delta_base_cache(struct packed_git *p, off_t base_offset,
1700 delta_base_cache_lru.prev = &ent->lru;
1701 }
1702
1703 +static void *read_object(const unsigned char *sha1, enum object_type *type,
1704 + unsigned long *size);
1705 +
1706 static void *unpack_delta_entry(struct packed_git *p,
1707 struct pack_window **w_curs,
1708 off_t curpos,
@@ -2130,8 +2133,8 @@ int pretend_sha1_file(void *buf, unsigned long len, enum object_type type,
2133 return 0;
2134 }
2135
2133 -void *read_object(const unsigned char *sha1, enum object_type *type,
2134 - unsigned long *size)
2136 +static void *read_object(const unsigned char *sha1, enum object_type *type,
2137 + unsigned long *size)
2138 {
2139 unsigned long mapsize;
2140 void *map, *buf;