Merge branch 'mh/ref-api'
Allows walking only a sub-hierarchy in refs/*. By Michael Haggerty * mh/ref-api: do_for_each_ref(): only iterate over the subtree that was requested refs: store references hierarchically sort_ref_dir(): simplify logic refs.c: rename ref_array -> ref_dir struct ref_entry: nest the value part in a union check_refname_component(): return 0 for zero-length components free_ref_entry(): new function names_conflict(): simplify implementation repack_without_ref(): reimplement using do_for_each_ref_in_array() do_for_each_ref_in_arrays(): new function do_for_each_ref_in_array(): new function refs: manage current_ref within do_one_ref() refs.c: reorder definitions more logically
This commit is contained in:
commit
5e69491bf2
7
refs.h
7
refs.h
@ -15,8 +15,11 @@ struct ref_lock {
|
||||
#define REF_ISBROKEN 0x04
|
||||
|
||||
/*
|
||||
* Calls the specified function for each ref file until it returns nonzero,
|
||||
* and returns the value
|
||||
* Calls the specified function for each ref file until it returns
|
||||
* nonzero, and returns the value. Please note that it is not safe to
|
||||
* modify references while an iteration is in progress, unless the
|
||||
* same callback function invocation that modifies the reference also
|
||||
* returns a nonzero value to immediately stop the iteration.
|
||||
*/
|
||||
typedef int each_ref_fn(const char *refname, const unsigned char *sha1, int flags, void *cb_data);
|
||||
extern int head_ref(each_ref_fn, void *);
|
||||
|
Loading…
Reference in New Issue
Block a user