All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] update-index: fix worktree setup
@ 2008-08-30  9:13 Nguyễn Thái Ngọc Duy
  0 siblings, 0 replies; only message in thread
From: Nguyễn Thái Ngọc Duy @ 2008-08-30  9:13 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin-update-index.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/builtin-update-index.c b/builtin-update-index.c
index 434cb8e..f201cf4 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -617,10 +617,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;
 			}
@@ -687,6 +689,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)
@@ -705,6 +708,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)
@@ -717,6 +721,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] == '"') {
-- 
1.6.0.96.g2fad1.dirty

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-30  9:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-30  9:13 [PATCH] update-index: fix worktree setup Nguyễn Thái Ngọc Duy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.