OSDN Git Service

Enable wt-status to run against non-standard index file.
authorKristian Høgsberg <krh@redhat.com>
Tue, 18 Sep 2007 00:06:43 +0000 (20:06 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Sep 2007 19:52:19 +0000 (12:52 -0700)
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>
wt-status.c
wt-status.h

index eeb1691..03b5ec4 100644 (file)
@@ -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)
index 4f3a615..7744932 100644 (file)
@@ -21,6 +21,7 @@ struct wt_status {
        int commitable;
        int workdir_dirty;
        int workdir_untracked;
+       const char *index_file;
        FILE *fp;
 };