aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2008-08-30 16:13:58 +0700
committerJunio C Hamano <gitster@pobox.com>2008-08-30 23:35:51 -0700
commitf83eafdd6251af29e259da8becb7610da9f3e933 (patch)
tree63e2abbed02b9313d6414f20f3f798e90618792b
parentb6469a81d228bd4b3e3fa62bbaf5fdd25915cd40 (diff)
downloadgit-f83eafdd6251af29e259da8becb7610da9f3e933.tar.gz
git-f83eafdd6251af29e259da8becb7610da9f3e933.tar.xz
update-index: fix worktree setup
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-update-index.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 38eb53ccb..f2c90ff1c 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -614,10 +614,12 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
continue;
}
if (!strcmp(path, "--refresh")) {
+ setup_work_tree();
has_errors |= refresh_cache(refresh_flags);
continue;
}
if (!strcmp(path, "--really-refresh")) {
+ setup_work_tree();
has_errors |= refresh_cache(REFRESH_REALLY | refresh_flags);
continue;
}
@@ -684,6 +686,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
goto finish;
}
if (!strcmp(path, "--again") || !strcmp(path, "-g")) {
+ setup_work_tree();
has_errors = do_reupdate(argc - i, argv + i,
prefix, prefix_length);
if (has_errors)
@@ -702,6 +705,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
usage(update_index_usage);
die("unknown option %s", path);
}
+ setup_work_tree();
p = prefix_path(prefix, prefix_length, path);
update_one(p, NULL, 0);
if (set_executable_bit)
@@ -714,6 +718,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
strbuf_init(&buf, 0);
strbuf_init(&nbuf, 0);
+ setup_work_tree();
while (strbuf_getline(&buf, stdin, line_termination) != EOF) {
const char *p;
if (line_termination && buf.buf[0] == '"') {