X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=repository.c;h=65e6f8b8fdfcf89e5c86cbee9590aa555f7b0b47;hb=ddc56d4710fa004c922349407f3de0c3adf90ac9;hp=20c509a9226645b1890c8433b22a7182699fc847;hpb=b99a579f8e434a7757f90895945b5711b3f159d5;p=thirdparty%2Fgit.git diff --git a/repository.c b/repository.c index 20c509a922..65e6f8b8fd 100644 --- a/repository.c +++ b/repository.c @@ -1,13 +1,20 @@ +/* + * not really _using_ the compat macros, just make sure the_index + * declaration matches the definition in this file. + */ +#define USE_THE_INDEX_COMPATIBILITY_MACROS #include "cache.h" #include "repository.h" #include "object-store.h" #include "config.h" #include "object.h" +#include "lockfile.h" #include "submodule-config.h" /* The main repository */ static struct repository the_repo; struct repository *the_repository; +struct index_state the_index; void initialize_the_repository(void) { @@ -256,3 +263,12 @@ int repo_read_index(struct repository *repo) return read_index_from(repo->index, repo->index_file, repo->gitdir); } + +int repo_hold_locked_index(struct repository *repo, + struct lock_file *lf, + int flags) +{ + if (!repo->index_file) + BUG("the repo hasn't been setup"); + return hold_lock_file_for_update(lf, repo->index_file, flags); +}