summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'path.c')
-rw-r--r--path.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/path.c b/path.c
index c1cb1cf627..e4abea0830 100644
--- a/path.c
+++ b/path.c
@@ -2,6 +2,7 @@
* Utilities for paths and pathnames
*/
#include "cache.h"
+#include "repository.h"
#include "strbuf.h"
#include "string-list.h"
#include "dir.h"
@@ -355,7 +356,7 @@ void report_linked_checkout_garbage(void)
const struct common_dir *p;
int len;
- if (!git_common_dir_env)
+ if (!the_repository->different_commondir)
return;
strbuf_addf(&sb, "%s/", get_git_dir());
len = sb.len;
@@ -374,17 +375,17 @@ void report_linked_checkout_garbage(void)
static void adjust_git_path(struct strbuf *buf, int git_dir_len)
{
const char *base = buf->buf + git_dir_len;
- if (git_graft_env && is_dir_file(base, "info", "grafts"))
+ if (is_dir_file(base, "info", "grafts"))
strbuf_splice(buf, 0, buf->len,
get_graft_file(), strlen(get_graft_file()));
- else if (git_index_env && !strcmp(base, "index"))
+ else if (!strcmp(base, "index"))
strbuf_splice(buf, 0, buf->len,
get_index_file(), strlen(get_index_file()));
- else if (git_db_env && dir_prefix(base, "objects"))
+ else if (dir_prefix(base, "objects"))
replace_dir(buf, git_dir_len + 7, get_object_directory());
else if (git_hooks_path && dir_prefix(base, "hooks"))
replace_dir(buf, git_dir_len + 5, git_hooks_path);
- else if (git_common_dir_env)
+ else if (the_repository->different_commondir)
update_common_dir(buf, git_dir_len, NULL);
}