t5702: use test_commit_bulk
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index 9f15fee85fcd5e863ce406e61ce218155adf5a60..bf20337ef435234acf171f76137e683e66fb22d2 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -339,7 +339,10 @@ struct index_state {
        struct cache_time timestamp;
        unsigned name_hash_initialized : 1,
                 initialized : 1,
-                drop_cache_tree : 1;
+                drop_cache_tree : 1,
+                updated_workdir : 1,
+                updated_skipworktree : 1,
+                fsmonitor_has_run_once : 1;
        struct hashmap name_hash;
        struct hashmap dir_hash;
        struct object_id oid;
@@ -823,7 +826,7 @@ int match_stat_data(const struct stat_data *sd, struct stat *st);
 int match_stat_data_racy(const struct index_state *istate,
                         const struct stat_data *sd, struct stat *st);
 
-void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
+void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, struct stat *st);
 
 #define REFRESH_REALLY         0x0001  /* ignore_valid */
 #define REFRESH_UNMERGED       0x0002  /* allow unmerged */
@@ -1045,8 +1048,10 @@ void check_repository_format(void);
  * Note that while this version avoids the static buffer, it is not fully
  * reentrant, as it calls into other non-reentrant git code.
  */
-const char *find_unique_abbrev(const struct object_id *oid, int len);
-int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len);
+const char *repo_find_unique_abbrev(struct repository *r, const struct object_id *oid, int len);
+#define find_unique_abbrev(oid, len) repo_find_unique_abbrev(the_repository, oid, len)
+int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len);
+#define find_unique_abbrev_r(hex, oid, len) repo_find_unique_abbrev_r(the_repository, hex, oid, len)
 
 extern const unsigned char null_sha1[GIT_MAX_RAWSZ];
 extern const struct object_id null_oid;
@@ -1331,7 +1336,7 @@ static inline int hex2chr(const char *s)
 #define FALLBACK_DEFAULT_ABBREV 7
 
 struct object_context {
-       unsigned mode;
+       unsigned short mode;
        /*
         * symlink_path is only used by get_tree_entry_follow_symlinks,
         * and only for symlinks that point outside the repository.
@@ -1378,19 +1383,32 @@ enum get_oid_result {
                       */
 };
 
-int get_oid(const char *str, struct object_id *oid);
-int get_oid_commit(const char *str, struct object_id *oid);
-int get_oid_committish(const char *str, struct object_id *oid);
-int get_oid_tree(const char *str, struct object_id *oid);
-int get_oid_treeish(const char *str, struct object_id *oid);
-int get_oid_blob(const char *str, struct object_id *oid);
-void maybe_die_on_misspelt_object_name(const char *name, const char *prefix);
+int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
+int get_oidf(struct object_id *oid, const char *fmt, ...);
+int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_tree(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_treeish(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_blob(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_mb(struct repository *r, const char *str, struct object_id *oid);
+void maybe_die_on_misspelt_object_name(struct repository *repo,
+                                      const char *name,
+                                      const char *prefix);
 enum get_oid_result get_oid_with_context(struct repository *repo, const char *str,
                                         unsigned flags, struct object_id *oid,
                                         struct object_context *oc);
 
+#define get_oid(str, oid)              repo_get_oid(the_repository, str, oid)
+#define get_oid_commit(str, oid)       repo_get_oid_commit(the_repository, str, oid)
+#define get_oid_committish(str, oid)   repo_get_oid_committish(the_repository, str, oid)
+#define get_oid_tree(str, oid)         repo_get_oid_tree(the_repository, str, oid)
+#define get_oid_treeish(str, oid)      repo_get_oid_treeish(the_repository, str, oid)
+#define get_oid_blob(str, oid)         repo_get_oid_blob(the_repository, str, oid)
+#define get_oid_mb(str, oid)           repo_get_oid_mb(the_repository, str, oid)
+
 typedef int each_abbrev_fn(const struct object_id *oid, void *);
-int for_each_abbrev(const char *prefix, each_abbrev_fn, void *);
+int repo_for_each_abbrev(struct repository *r, const char *prefix, each_abbrev_fn, void *);
+#define for_each_abbrev(prefix, fn, data) repo_for_each_abbrev(the_repository, prefix, fn, data)
 
 int set_disambiguate_hint_config(const char *var, const char *value);
 
@@ -1468,9 +1486,12 @@ int parse_oid_hex(const char *hex, struct object_id *oid, const char **end);
 #define INTERPRET_BRANCH_LOCAL (1<<0)
 #define INTERPRET_BRANCH_REMOTE (1<<1)
 #define INTERPRET_BRANCH_HEAD (1<<2)
-int interpret_branch_name(const char *str, int len, struct strbuf *,
-                         unsigned allowed);
-int get_oid_mb(const char *str, struct object_id *oid);
+int repo_interpret_branch_name(struct repository *r,
+                              const char *str, int len,
+                              struct strbuf *buf,
+                              unsigned allowed);
+#define interpret_branch_name(str, len, buf, allowed) \
+       repo_interpret_branch_name(the_repository, str, len, buf, allowed)
 
 int validate_headref(const char *ref);
 
@@ -1484,8 +1505,11 @@ void *read_object_with_reference(const struct object_id *oid,
                                 unsigned long *size,
                                 struct object_id *oid_ret);
 
-struct object *peel_to_type(const char *name, int namelen,
-                           struct object *o, enum object_type);
+struct object *repo_peel_to_type(struct repository *r,
+                                const char *name, int namelen,
+                                struct object *o, enum object_type);
+#define peel_to_type(name, namelen, obj, type) \
+       repo_peel_to_type(the_repository, name, namelen, obj, type)
 
 enum date_mode_type {
        DATE_NORMAL = 0,
@@ -1552,6 +1576,10 @@ const char *git_sequence_editor(void);
 const char *git_pager(int stdout_is_tty);
 int is_terminal_dumb(void);
 int git_ident_config(const char *, const char *, void *);
+/*
+ * Prepare an ident to fall back on if the user didn't configure it.
+ */
+void prepare_fallback_ident(const char *name, const char *email);
 void reset_ident_date(void);
 
 struct ident_split {