diff options
Diffstat (limited to 'cache.h')
| -rw-r--r-- | cache.h | 36 |
1 files changed, 6 insertions, 30 deletions
@@ -433,42 +433,18 @@ typedef int (*must_prefetch_predicate)(const struct cache_entry *); void prefetch_cache_entries(const struct index_state *istate, must_prefetch_predicate must_prefetch); -#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS +#if defined(USE_THE_INDEX_COMPATIBILITY_MACROS) || defined(USE_THE_INDEX_VARIABLE) extern struct index_state the_index; -#define active_cache (the_index.cache) +#ifndef USE_THE_INDEX_VARIABLE +#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS #define active_nr (the_index.cache_nr) -#define active_alloc (the_index.cache_alloc) -#define active_cache_changed (the_index.cache_changed) -#define active_cache_tree (the_index.cache_tree) #define read_cache() repo_read_index(the_repository) -#define read_cache_from(path) read_index_from(&the_index, (path), (get_git_dir())) -#define read_cache_preload(pathspec) repo_read_index_preload(the_repository, (pathspec), 0) -#define is_cache_unborn() is_index_unborn(&the_index) -#define read_cache_unmerged() repo_read_index_unmerged(the_repository) #define discard_cache() discard_index(&the_index) -#define unmerged_cache() unmerged_index(&the_index) #define cache_name_pos(name, namelen) index_name_pos(&the_index,(name),(namelen)) -#define add_cache_entry(ce, option) add_index_entry(&the_index, (ce), (option)) -#define rename_cache_entry_at(pos, new_name) rename_index_entry_at(&the_index, (pos), (new_name)) -#define remove_cache_entry_at(pos) remove_index_entry_at(&the_index, (pos)) -#define remove_file_from_cache(path) remove_file_from_index(&the_index, (path)) -#define add_to_cache(path, st, flags) add_to_index(&the_index, (path), (st), (flags)) -#define add_file_to_cache(path, flags) add_file_to_index(&the_index, (path), (flags)) -#define chmod_cache_entry(ce, flip) chmod_index_entry(&the_index, (ce), (flip)) -#define refresh_cache(flags) refresh_index(&the_index, (flags), NULL, NULL, NULL) -#define refresh_and_write_cache(refresh_flags, write_flags, gentle) repo_refresh_and_write_index(the_repository, (refresh_flags), (write_flags), (gentle), NULL, NULL, NULL) -#define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options)) -#define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options)) -#define cache_dir_exists(name, namelen) index_dir_exists(&the_index, (name), (namelen)) -#define cache_file_exists(name, namelen, igncase) index_file_exists(&the_index, (name), (namelen), (igncase)) -#define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen)) -#define resolve_undo_clear() resolve_undo_clear_index(&the_index) -#define unmerge_cache_entry_at(at) unmerge_index_entry_at(&the_index, at) -#define unmerge_cache(pathspec) unmerge_index(&the_index, pathspec) -#define read_blob_data_from_cache(path, sz) read_blob_data_from_index(&the_index, (path), (sz)) -#define hold_locked_index(lock_file, flags) repo_hold_locked_index(the_repository, (lock_file), (flags)) +#endif +#endif #endif #define TYPE_BITS 3 @@ -789,7 +765,7 @@ void ensure_full_index(struct index_state *istate); */ int write_locked_index(struct index_state *, struct lock_file *lock, unsigned flags); -int discard_index(struct index_state *); +void discard_index(struct index_state *); void move_index_extensions(struct index_state *dst, struct index_state *src); int unmerged_index(const struct index_state *); |
