{"thread":{"id":"15281","subject":"[PATCH] update-index: fix worktree setup","startedAt":"2008-08-30T09:13:58Z","lastAt":"2008-08-30T09:13:58Z","messageCount":1,"participants":["Nguyễn Thái Ngọc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"89194","messageId":"1220087638-2202-1-git-send-email-pclouds@gmail.com","threadId":"15281","inReplyTo":null,"subject":"[PATCH] update-index: fix worktree setup","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-08-30T09:13:58Z","receivedAt":"2008-08-30T09:13:58Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin-update-index.c |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-update-index.c b/builtin-update-index.c\nindex 434cb8e..f201cf4 100644\n--- a/builtin-update-index.c\n+++ b/builtin-update-index.c\n@@ -617,10 +617,12 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (!strcmp(path, \"--refresh\")) {\n+\t\t\t\tsetup_work_tree();\n \t\t\t\thas_errors |= refresh_cache(refresh_flags);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (!strcmp(path, \"--really-refresh\")) {\n+\t\t\t\tsetup_work_tree();\n \t\t\t\thas_errors |= refresh_cache(REFRESH_REALLY | refresh_flags);\n \t\t\t\tcontinue;\n \t\t\t}\n@@ -687,6 +689,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\t\t\tgoto finish;\n \t\t\t}\n \t\t\tif (!strcmp(path, \"--again\") || !strcmp(path, \"-g\")) {\n+\t\t\t\tsetup_work_tree();\n \t\t\t\thas_errors = do_reupdate(argc - i, argv + i,\n \t\t\t\t\t\t\t prefix, prefix_length);\n \t\t\t\tif (has_errors)\n@@ -705,6 +708,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\t\t\tusage(update_index_usage);\n \t\t\tdie(\"unknown option %s\", path);\n \t\t}\n+\t\tsetup_work_tree();\n \t\tp = prefix_path(prefix, prefix_length, path);\n \t\tupdate_one(p, NULL, 0);\n \t\tif (set_executable_bit)\n@@ -717,6 +721,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \n \t\tstrbuf_init(&buf, 0);\n \t\tstrbuf_init(&nbuf, 0);\n+\t\tsetup_work_tree();\n \t\twhile (strbuf_getline(&buf, stdin, line_termination) != EOF) {\n \t\t\tconst char *p;\n \t\t\tif (line_termination && buf.buf[0] == '\"') {\n-- \n1.6.0.96.g2fad1.dirty\n"}]}