diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2017-03-26 04:42:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-14 12:53:25 +0200 |
commit | 18d0002d6ddc191454b6b4a99cdac65fc7ff9ece (patch) | |
tree | d8c5067ff5875719269bd32eb6466b2d939759f1 /refs.h | |
parent | files-backend: replace submodule_allowed check in files_downcast() (diff) | |
download | git-18d0002d6ddc191454b6b4a99cdac65fc7ff9ece.tar.xz git-18d0002d6ddc191454b6b4a99cdac65fc7ff9ece.zip |
refs: rename get_ref_store() to get_submodule_ref_store() and make it public
This function is intended to replace *_submodule() refs API. It provides
a ref store for a specific submodule, which can be operated on by a new
set of refs API.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r-- | refs.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -562,5 +562,16 @@ int reflog_expire(const char *refname, const unsigned char *sha1, int ref_storage_backend_exists(const char *name); struct ref_store *get_main_ref_store(void); +/* + * Return the ref_store instance for the specified submodule. For the + * main repository, use submodule==NULL; such a call cannot fail. For + * a submodule, the submodule must exist and be a nonbare repository, + * otherwise return NULL. If the requested reference store has not yet + * been initialized, initialize it first. + * + * For backwards compatibility, submodule=="" is treated the same as + * submodule==NULL. + */ +struct ref_store *get_submodule_ref_store(const char *submodule); #endif /* REFS_H */ |