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>
This commit is contained in:
parent
abc776f788
commit
c2c5b27051
3
cache.h
3
cache.h
@ -631,9 +631,6 @@ extern int write_sha1_file(void *buf, unsigned long len, const char *type, unsig
|
|||||||
extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
|
extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
|
||||||
extern int force_object_loose(const unsigned char *sha1, time_t mtime);
|
extern int force_object_loose(const unsigned char *sha1, time_t mtime);
|
||||||
|
|
||||||
/* just like read_sha1_file(), but non fatal in presence of bad objects */
|
|
||||||
extern void *read_object(const unsigned char *sha1, enum object_type *type, unsigned long *size);
|
|
||||||
|
|
||||||
/* global flag to enable extra checks when accessing packed objects */
|
/* global flag to enable extra checks when accessing packed objects */
|
||||||
extern int do_check_packed_object_crc;
|
extern int do_check_packed_object_crc;
|
||||||
|
|
||||||
|
@ -1700,6 +1700,9 @@ static void add_delta_base_cache(struct packed_git *p, off_t base_offset,
|
|||||||
delta_base_cache_lru.prev = &ent->lru;
|
delta_base_cache_lru.prev = &ent->lru;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void *read_object(const unsigned char *sha1, enum object_type *type,
|
||||||
|
unsigned long *size);
|
||||||
|
|
||||||
static void *unpack_delta_entry(struct packed_git *p,
|
static void *unpack_delta_entry(struct packed_git *p,
|
||||||
struct pack_window **w_curs,
|
struct pack_window **w_curs,
|
||||||
off_t curpos,
|
off_t curpos,
|
||||||
@ -2130,7 +2133,7 @@ int pretend_sha1_file(void *buf, unsigned long len, enum object_type type,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *read_object(const unsigned char *sha1, enum object_type *type,
|
static void *read_object(const unsigned char *sha1, enum object_type *type,
|
||||||
unsigned long *size)
|
unsigned long *size)
|
||||||
{
|
{
|
||||||
unsigned long mapsize;
|
unsigned long mapsize;
|
||||||
|
Loading…
Reference in New Issue
Block a user