Skip to content

Commit

Permalink
Enable wt-status to run against non-standard index file.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kristian Høgsberg authored and gitster committed Sep 19, 2007
1 parent f26a001 commit 0f729f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wt-status.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions wt-status.h
Expand Up @@ -21,6 +21,7 @@ struct wt_status {
int commitable;
int workdir_dirty;
int workdir_untracked;
const char *index_file;
FILE *fp;
};

Expand Down

0 comments on commit 0f729f2

Please sign in to comment.