diff options
author | Jeff King <peff@peff.net> | 2016-10-03 16:35:03 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-10 13:52:36 -0700 |
commit | a5b34d21521c015cd41ced4a3fdde57d79891eb3 (patch) | |
tree | 4cd7013288363bdde05efe99985d66c7c8d3a309 /cache.h | |
parent | 4ea82473aa310de7543141f96c2e6b23ef9fcd4c (diff) | |
download | git-a5b34d21521c015cd41ced4a3fdde57d79891eb3.tar.gz git-a5b34d21521c015cd41ced4a3fdde57d79891eb3.tar.xz |
alternates: provide helper for adding to alternates list
The submodule code wants to temporarily add an alternate
object store to our in-memory alt_odb list, but does it
manually. Let's provide a helper so it can reuse the code in
link_alt_odb_entry().
While we're adding our new add_to_alternates_memory(), let's
document add_to_alternates_file(), as the two are related.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1389,10 +1389,22 @@ extern struct alternate_object_database { extern void prepare_alt_odb(void); extern void read_info_alternates(const char * relative_base, int depth); extern char *compute_alternate_path(const char *path, struct strbuf *err); -extern void add_to_alternates_file(const char *reference); typedef int alt_odb_fn(struct alternate_object_database *, void *); extern int foreach_alt_odb(alt_odb_fn, void*); +/* + * Add the directory to the on-disk alternates file; the new entry will also + * take effect in the current process. + */ +extern void add_to_alternates_file(const char *dir); + +/* + * Add the directory to the in-memory list of alternates (along with any + * recursive alternates it points to), but do not modify the on-disk alternates + * file. + */ +extern void add_to_alternates_memory(const char *dir); + struct pack_window { struct pack_window *next; unsigned char *base; |