From 0f729f21348c43a1c80f48faed2e753b1c923e85 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 17 Sep 2007 20:06:43 -0400 Subject: [PATCH] Enable wt-status to run against non-standard index file. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We still default to get_index_file(), but this can be overridden by setting wt_status.index_file after calling wt_status_prepare(). Signed-off-by: Kristian Høgsberg Signed-off-by: Junio C Hamano --- wt-status.c | 3 ++- wt-status.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wt-status.c b/wt-status.c index eeb16915c..03b5ec448 100644 --- a/wt-status.c +++ b/wt-status.c @@ -53,6 +53,7 @@ void wt_status_prepare(struct wt_status *s) s->branch = head ? xstrdup(head) : NULL; s->reference = "HEAD"; s->fp = stdout; + s->index_file = get_index_file(); } static void wt_status_print_cached_header(struct wt_status *s) @@ -198,7 +199,7 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q, static void wt_read_cache(struct wt_status *s) { discard_cache(); - read_cache(); + read_cache_from(s->index_file); } static void wt_status_print_initial(struct wt_status *s) diff --git a/wt-status.h b/wt-status.h index 4f3a615c3..77449326d 100644 --- a/wt-status.h +++ b/wt-status.h @@ -21,6 +21,7 @@ struct wt_status { int commitable; int workdir_dirty; int workdir_untracked; + const char *index_file; FILE *fp; }; -- 2.30.2