X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=cache.h;h=d5d7fe4f8c66b2fa39a33361b8efae56e3dbf742;hb=7612a1efdb0c0806b43db10ce784707aae874340;hp=8c9947ef49846151fe4b25e6c472864bfa7d9f71;hpb=1af1c2b63db6a413fbeb9b08cd55dcb735d7597d;p=git.git diff --git a/cache.h b/cache.h index 8c9947ef..d5d7fe4f 100644 --- a/cache.h +++ b/cache.h @@ -114,6 +114,7 @@ static inline unsigned int create_ce_mode(unsigned int mode) extern struct cache_entry **active_cache; extern unsigned int active_nr, active_alloc, active_cache_changed; +extern struct cache_tree *active_cache_tree; #define GIT_DIR_ENVIRONMENT "GIT_DIR" #define DEFAULT_GIT_DIR_ENVIRONMENT ".git" @@ -134,15 +135,15 @@ extern const char *setup_git_directory_gently(int *); extern const char *setup_git_directory(void); extern const char *prefix_path(const char *prefix, int len, const char *path); extern const char *prefix_filename(const char *prefix, int len, const char *path); +extern void verify_filename(const char *prefix, const char *name); +extern void verify_non_filename(const char *prefix, const char *name); #define alloc_nr(x) (((x)+16)*3/2) /* Initialize and use the cache information */ -extern int read_cache_1(unsigned char *); -extern int write_cache_1(int, struct cache_entry **, int, unsigned char *); extern int read_cache(void); -extern int write_cache(int, struct cache_entry **, int); - +extern int write_cache(int newfd, struct cache_entry **cache, int entries); +extern int verify_path(const char *path); extern int cache_name_pos(const char *name, int namelen); #define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */ #define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */ @@ -155,22 +156,30 @@ extern int ce_match_stat(struct cache_entry *ce, struct stat *st, int); extern int ce_modified(struct cache_entry *ce, struct stat *st, int); extern int ce_path_match(const struct cache_entry *ce, const char **pathspec); extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, const char *type); +extern int read_pipe(int fd, char** return_buf, unsigned long* return_size); extern int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object); extern int index_path(unsigned char *sha1, const char *path, struct stat *st, int write_object); extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st); -struct cache_file { - struct cache_file *next; - char lockfile[PATH_MAX]; +#define REFRESH_REALLY 0x0001 /* ignore_valid */ +#define REFRESH_UNMERGED 0x0002 /* allow unmerged */ +#define REFRESH_QUIET 0x0004 /* be quiet about it */ +#define REFRESH_IGNORE_MISSING 0x0008 /* ignore non-existent */ +extern int refresh_cache(unsigned int flags); + +struct lock_file { + struct lock_file *next; + char filename[PATH_MAX]; }; -extern int hold_index_file_for_update(struct cache_file *, const char *path); -extern int commit_index_file(struct cache_file *); -extern void rollback_index_file(struct cache_file *); +extern int hold_lock_file_for_update(struct lock_file *, const char *path); +extern int commit_lock_file(struct lock_file *); +extern void rollback_lock_file(struct lock_file *); /* Environment bits from configuration mechanism */ extern int trust_executable_bit; extern int assume_unchanged; -extern int only_use_symrefs; +extern int prefer_symlink_refs; +extern int log_all_ref_updates; extern int warn_ambiguous_refs; extern int diff_rename_limit_default; extern int shared_repository; @@ -252,6 +261,7 @@ extern void *read_object_with_reference(const unsigned char *sha1, unsigned char *sha1_ret); const char *show_date(unsigned long time, int timezone); +const char *show_rfc2822_date(unsigned long time, int timezone); int parse_date(const char *date, char *buf, int bufsize); void datestamp(char *buf, int bufsize); unsigned long approxidate(const char *); @@ -364,4 +374,8 @@ extern int receive_keep_pack(int fd[2], const char *me, int quiet); /* pager.c */ extern void setup_pager(void); +/* base85 */ +int decode_85(char *dst, char *line, int linelen); +void encode_85(char *buf, unsigned char *data, int bytes); + #endif /* CACHE_H */