diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-09-03 15:35:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-09-03 15:35:37 -0700 |
commit | 6a42cfe86c485675987b64690e75d8821567d328 (patch) | |
tree | be6e1a64fa65abe7f0013e0256a9439f6e73e0ac /builtin-update-index.c | |
parent | 36f44a06802960abce7febbf9cc40461e5546ee5 (diff) | |
parent | bb528633b34ac9c338a7761f3e1d251e0c560ed6 (diff) | |
download | git-6a42cfe86c485675987b64690e75d8821567d328.tar.gz git-6a42cfe86c485675987b64690e75d8821567d328.tar.xz |
Merge branch 'nd/worktree' into maint
* nd/worktree:
setup_git_directory(): fix move to worktree toplevel directory
update-index: fix worktree setup
read-tree: setup worktree if merge is required
grep: fix worktree setup
diff*: fix worktree setup
Diffstat (limited to 'builtin-update-index.c')
-rw-r--r-- | 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 e5bb2a03c..5637d417a 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] == '"') { |