X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=refs.h;h=5e7a9a59f5f6b687d15eb37a11696433bdc8f15c;hb=67e223edc4013b0b3b1caad336e4a43f6d4c66b8;hp=f7648b9bd3b719936024678246d0603028e72aa7;hpb=cb198b3b67feb2c0a6f22199ec14fa48d18ac1ce;p=git.git diff --git a/refs.h b/refs.h index f7648b9bd..5e7a9a59f 100644 --- a/refs.h +++ b/refs.h @@ -28,6 +28,19 @@ extern int for_each_replace_ref(each_ref_fn, void *); extern int for_each_glob_ref(each_ref_fn, const char *pattern, void *); extern int for_each_glob_ref_in(each_ref_fn, const char *pattern, const char* prefix, void *); +extern int head_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data); +extern int for_each_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data); +extern int for_each_ref_in_submodule(const char *submodule, const char *prefix, + each_ref_fn fn, void *cb_data); +extern int for_each_tag_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data); +extern int for_each_branch_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data); +extern int for_each_remote_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data); + +static inline const char *has_glob_specials(const char *pattern) +{ + return strpbrk(pattern, "?*["); +} + /* can be used to learn about broken ref and symref */ extern int for_each_rawref(each_ref_fn, void *); @@ -63,6 +76,9 @@ extern void unlock_ref(struct ref_lock *lock); /** Writes sha1 into the ref specified by the lock. **/ extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg); +/** Setup reflog before using. **/ +int log_ref_setup(const char *ref_name, char *logfile, int bufsize); + /** Reads log for the value of ref during at_time. **/ extern int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *sha1, char **msg, unsigned long *cutoff_time, int *cutoff_tz, int *cutoff_cnt);