diff options
Diffstat (limited to 'builtin/init-db.c')
| -rw-r--r-- | builtin/init-db.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c index 582dcf20f8..7e00d57d65 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -3,6 +3,7 @@ * * Copyright (C) Linus Torvalds, 2005 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "environment.h" @@ -11,7 +12,6 @@ #include "parse-options.h" #include "path.h" #include "refs.h" -#include "repository.h" #include "setup.h" #include "strbuf.h" @@ -70,7 +70,10 @@ static const char *const init_db_usage[] = { * On the other hand, it might just make lookup slower and messier. You * be the judge. The default case is to have one DB per managed directory. */ -int cmd_init_db(int argc, const char **argv, const char *prefix) +int cmd_init_db(int argc, + const char **argv, + const char *prefix, + struct repository *repo UNUSED) { const char *git_dir; const char *real_git_dir = NULL; @@ -231,9 +234,9 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) set_git_work_tree(work_tree); else set_git_work_tree(git_work_tree_cfg); - if (access(get_git_work_tree(), X_OK)) + if (access(repo_get_work_tree(the_repository), X_OK)) die_errno (_("Cannot access work tree '%s'"), - get_git_work_tree()); + repo_get_work_tree(the_repository)); } else { if (real_git_dir) |
