]> git.ipfire.org Git - thirdparty/git.git/blobdiff - repository.c
tests: mark a couple more test cases as requiring `rebase -p`
[thirdparty/git.git] / repository.c
index 20c509a9226645b1890c8433b22a7182699fc847..5cad2dcc86a530ab088cda98a5c64bbe78102038 100644 (file)
@@ -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)
 {
@@ -119,6 +126,8 @@ out:
 void repo_set_worktree(struct repository *repo, const char *path)
 {
        repo->worktree = real_pathdup(path, 1);
+
+       trace2_def_repo(repo);
 }
 
 static int read_and_verify_repository_format(struct repository_format *format,
@@ -256,3 +265,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);
+}