Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/repository.c b/repository.c
index 7b02e1dffa..9411c4baee 100644
--- a/repository.c
+++ b/repository.c
@@ -3,6 +3,7 @@
#include "object-store.h"
#include "config.h"
#include "object.h"
+#include "lockfile.h"
#include "submodule-config.h"
/* The main repository */
@@ -263,3 +264,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);
+}