summaryrefslogtreecommitdiffstats
path: root/builtin/reset.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/reset.c')
-rw-r--r--builtin/reset.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/builtin/reset.c b/builtin/reset.c
index 5f941fb3a2..7154f88826 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -7,7 +7,7 @@
*
* Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -26,6 +26,7 @@
#include "object-name.h"
#include "parse-options.h"
#include "path.h"
+#include "repository.h"
#include "unpack-trees.h"
#include "cache-tree.h"
#include "setup.h"
@@ -330,7 +331,10 @@ static int git_reset_config(const char *var, const char *value,
return git_default_config(var, value, ctx, cb);
}
-int cmd_reset(int argc, const char **argv, const char *prefix)
+int cmd_reset(int argc,
+ const char **argv,
+ const char *prefix,
+ struct repository *repo UNUSED)
{
int reset_type = NONE, update_ref_status = 0, quiet = 0;
int no_refresh = 0;
@@ -441,7 +445,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
else
trace2_cmd_mode(reset_type_names[reset_type]);
- if (reset_type != SOFT && (reset_type != MIXED || get_git_work_tree()))
+ if (reset_type != SOFT && (reset_type != MIXED || repo_get_work_tree(the_repository)))
setup_work_tree();
if (reset_type == MIXED && is_bare_repository())
@@ -474,7 +478,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
goto cleanup;
}
the_repository->index->updated_skipworktree = 1;
- if (!no_refresh && get_git_work_tree()) {
+ if (!no_refresh && repo_get_work_tree(the_repository)) {
uint64_t t_begin, t_delta_in_ms;
t_begin = getnanotime();