{"thread":{"id":"9315","subject":"[PATCH] Enable wt-status to run against non-standard index file.","startedAt":"2007-07-30T21:35:15Z","lastAt":"2007-07-30T21:35:15Z","messageCount":1,"participants":["Kristian Høgsberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"49151","messageId":"11858313152934-git-send-email-krh@redhat.com","threadId":"9315","inReplyTo":null,"subject":"[PATCH] Enable wt-status to run against non-standard index file.","fromName":"Kristian Høgsberg","fromEmail":"krh@redhat.com","sentAt":"2007-07-30T21:35:15Z","receivedAt":"2007-07-30T21:35:15Z","isPatch":true,"sender":{"key":"krh@redhat.com","avatar":"https://gravatar.com/avatar/763dee6f9594ac474f725b137a39565792928e583ddf59b32befc2907409027e?d=mp&s=160"},"body":"We still default to get_index_file(), but this can be overridden\nby setting wt_status.index_file after calling wt_status_prepare().\n\nSigned-off-by: Kristian Høgsberg <krh@redhat.com>\n---\n wt-status.c |    3 ++-\n wt-status.h |    1 +\n 2 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 65a7259..0cf9b81 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -53,6 +53,7 @@ void wt_status_prepare(struct wt_status *s)\n \ts->branch = head ? xstrdup(head) : NULL;\n \ts->reference = \"HEAD\";\n \ts->fp = stdout;\n+\ts->index_file = get_index_file();\n }\n \n static void wt_status_print_cached_header(struct wt_status *s)\n@@ -198,7 +199,7 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,\n static void wt_read_cache(struct wt_status *s)\n {\n \tdiscard_cache();\n-\tread_cache();\n+\tread_cache_from(s->index_file);\n }\n \n static void wt_status_print_initial(struct wt_status *s)\ndiff --git a/wt-status.h b/wt-status.h\nindex 4f3a615..7744932 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -21,6 +21,7 @@ struct wt_status {\n \tint commitable;\n \tint workdir_dirty;\n \tint workdir_untracked;\n+\tconst char *index_file;\n \tFILE *fp;\n };\n \n-- \n1.5.2.GIT\n"}]}