@matheusbsbs / matheus-bagliano / commits / 0f729f2134
Fork 0

Enable wt-status to run against non-standard index file.

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 <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kristian Høgsberg committed Sep 17, 2007 at 20:06 UTC 0f729f21348c43a1c80f48faed2e753b1c923e85
2 files changed +3 -1
wt-status.c
+2 -1
@@ -53,6 +53,7 @@ void wt_status_prepare(struct wt_status *s)
53 s->branch = head ? xstrdup(head) : NULL;
54 s->reference = "HEAD";
55 s->fp = stdout;
56 + s->index_file = get_index_file();
57 }
58
59 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,
199 static void wt_read_cache(struct wt_status *s)
200 {
201 discard_cache();
201 - read_cache();
202 + read_cache_from(s->index_file);
203 }
204
205 static void wt_status_print_initial(struct wt_status *s)
wt-status.h
+1
@@ -21,6 +21,7 @@ struct wt_status {
21 int commitable;
22 int workdir_dirty;
23 int workdir_untracked;
24 + const char *index_file;
25 FILE *fp;
26 };
27