Merge branch 'mo/clang-format-for-each-update'
[gitweb.git] / packfile.h
index 0e051ad5d3e33965400cff53c7b3bd97c498461a..b678d35c0b6df11623f2d29f7b7ea7dfe0e1bea1 100644 (file)
@@ -31,6 +31,12 @@ char *sha1_pack_name(const unsigned char *sha1);
  */
 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,
@@ -57,10 +63,11 @@ struct packed_git *get_all_packs(struct repository *r);
  * 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);
 
@@ -144,8 +151,8 @@ void release_pack_memory(size_t);
 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);
@@ -177,6 +184,6 @@ int is_promisor_object(const struct object_id *oid);
  * 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