*/
char *sha1_pack_index_name(const unsigned char *sha1);
+/*
+ * Return the basename of the packfile, omitting any containing directory
+ * (e.g., "pack-1234abcd[...].pack").
+ */
+const char *pack_basename(struct packed_git *p);
+
struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path);
typedef void each_file_in_pack_dir_fn(const char *full_path, size_t full_path_len,
* Give a rough count of objects in the repository. This sacrifices accuracy
* for speed.
*/
-unsigned long approximate_object_count(void);
+unsigned long repo_approximate_object_count(struct repository *r);
+#define approximate_object_count() repo_approximate_object_count(the_repository)
struct packed_git *find_sha1_pack(const unsigned char *sha1,
- struct packed_git *packs);
+ struct packed_git *packs);
void pack_report(void);
extern int do_check_packed_object_crc;
int packed_object_info(struct repository *r,
- struct packed_git *pack,
- off_t offset, struct object_info *);
+ struct packed_git *pack,
+ off_t offset, struct object_info *);
void mark_bad_packed_object(struct packed_git *p, const unsigned char *sha1);
const struct packed_git *has_packed_and_bad(struct repository *r, const unsigned char *sha1);
* probably use open_pack_index() or parse_pack_index() instead.
*/
int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
- size_t idx_size, struct packed_git *p);
+ size_t idx_size, struct packed_git *p);
#endif