X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=refs.h;h=e1c5803f9a5aba0b6ba18f5a9bd5192cba661542;hb=3b6e73a3b18336cf123993b191e3fab6442bd5a3;hp=6daa78eb50ddc195c6d5bfb568d0b05ab08f7923;hpb=c78e182d55b96b40729be83e55999a93e1499a4c;p=git-core%2Fgit.git diff --git a/refs.h b/refs.h index 6daa78eb5..e1c5803f9 100644 --- a/refs.h +++ b/refs.h @@ -10,10 +10,11 @@ struct worktree; /* * Resolve a reference, recursively following symbolic refererences. * - * Store the referred-to object's name in sha1 and return the name of - * the non-symbolic reference that ultimately pointed at it. The - * return value, if not NULL, is a pointer into either a static buffer - * or the input ref. + * Return the name of the non-symbolic reference that ultimately pointed + * at the resolved object name. The return value, if not NULL, is a + * pointer into either a static buffer or the input ref. + * + * If sha1 is non-NULL, store the referred-to object's name in it. * * If the reference cannot be resolved to an object, the behavior * depends on the RESOLVE_REF_READING flag: @@ -275,6 +276,8 @@ typedef int each_ref_fn(const char *refname, * modifies the reference also returns a nonzero value to immediately * stop the iteration. Returned references are sorted. */ +int refs_head_ref(struct ref_store *refs, + each_ref_fn fn, void *cb_data); int refs_for_each_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data); int refs_for_each_ref_in(struct ref_store *refs, const char *prefix, @@ -289,6 +292,9 @@ int refs_for_each_remote_ref(struct ref_store *refs, int head_ref(each_ref_fn fn, void *cb_data); int for_each_ref(each_ref_fn fn, void *cb_data); int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data); +int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix, + each_ref_fn fn, void *cb_data, + unsigned int broken); int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data, unsigned int broken); int for_each_tag_ref(each_ref_fn fn, void *cb_data); @@ -299,21 +305,6 @@ int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data); int for_each_glob_ref_in(each_ref_fn fn, const char *pattern, const char *prefix, void *cb_data); -int head_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data); -int for_each_ref_submodule(const char *submodule, - each_ref_fn fn, void *cb_data); -int for_each_ref_in_submodule(const char *submodule, const char *prefix, - each_ref_fn fn, void *cb_data); -int for_each_fullref_in_submodule(const char *submodule, const char *prefix, - each_ref_fn fn, void *cb_data, - unsigned int broken); -int for_each_tag_ref_submodule(const char *submodule, - each_ref_fn fn, void *cb_data); -int for_each_branch_ref_submodule(const char *submodule, - each_ref_fn fn, void *cb_data); -int for_each_remote_ref_submodule(const char *submodule, - each_ref_fn fn, void *cb_data); - int head_ref_namespaced(each_ref_fn fn, void *cb_data); int for_each_namespaced_ref(each_ref_fn fn, void *cb_data); @@ -355,6 +346,14 @@ int refs_pack_refs(struct ref_store *refs, unsigned int flags); #define REF_FORCE_CREATE_REFLOG 0x40 /* + * Flags that can be passed in to ref_transaction_update + */ +#define REF_TRANSACTION_UPDATE_ALLOWED_FLAGS \ + REF_ISPRUNING | \ + REF_FORCE_CREATE_REFLOG | \ + REF_NODEREF + +/* * Setup reflog before using. Fill in err and return -1 on failure. */ int refs_create_reflog(struct ref_store *refs, const char *refname,