read-cache.c: split racy stat test to a separate function
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index f704af5df0984e092fe318e535596921c4ea7122..811cc36547aa5b2b036f56e7d4a2c6dd100e913d 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -291,6 +291,8 @@ static inline unsigned int canon_mode(unsigned int mode)
 #define SPLIT_INDEX_ORDERED    (1 << 6)
 
 struct split_index;
+struct untracked_cache;
+
 struct index_state {
        struct cache_entry **cache;
        unsigned int version;
@@ -304,6 +306,7 @@ struct index_state {
        struct hashmap name_hash;
        struct hashmap dir_hash;
        unsigned char sha1[20];
+       struct untracked_cache *untracked;
 };
 
 extern struct index_state the_index;
@@ -568,7 +571,7 @@ extern void update_index_if_able(struct index_state *, struct lock_file *);
 extern int hold_locked_index(struct lock_file *, int);
 extern void set_alternate_index_output(const char *);
 
-extern int delete_ref(const char *, const unsigned char *sha1, int delopt);
+extern int delete_ref(const char *, const unsigned char *sha1, unsigned int flags);
 
 /* Environment bits from configuration mechanism */
 extern int trust_executable_bit;
@@ -1254,6 +1257,10 @@ extern int unpack_object_header(struct packed_git *, struct pack_window **, off_
  *
  * Any callback that is NULL will be ignored. Callbacks returning non-zero
  * will end the iteration.
+ *
+ * In the "buf" variant, "path" is a strbuf which will also be used as a
+ * scratch buffer, but restored to its original contents before
+ * the function returns.
  */
 typedef int each_loose_object_fn(const unsigned char *sha1,
                                 const char *path,
@@ -1269,6 +1276,11 @@ int for_each_loose_file_in_objdir(const char *path,
                                  each_loose_cruft_fn cruft_cb,
                                  each_loose_subdir_fn subdir_cb,
                                  void *data);
+int for_each_loose_file_in_objdir_buf(struct strbuf *path,
+                                     each_loose_object_fn obj_cb,
+                                     each_loose_cruft_fn cruft_cb,
+                                     each_loose_subdir_fn subdir_cb,
+                                     void *data);
 
 /*
  * Iterate over loose and packed objects in both the local
@@ -1498,7 +1510,7 @@ extern const char *pager_program;
 extern int pager_in_use(void);
 extern int pager_use_color;
 extern int term_columns(void);
-extern int decimal_width(int);
+extern int decimal_width(uintmax_t);
 extern int check_pager_config(const char *cmd);
 
 extern const char *editor_program;