wt-status: move many global settings to wt_status structure

Turn four global variables (wt_status_use_color, show_tracked_files,
wt_status_relative_paths, and wt_status_submodule_summary) into fields of
wt_status structure.  They can also lose "wt_status_" prefix.

Get rid of "untracked" field that was used only to keep track of otherwise
available information redundantly.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2009-08-09 21:59:30 -07:00
parent 3a5d13a3c3
commit d249b09889
3 changed files with 93 additions and 84 deletions

View File

@ -18,7 +18,6 @@ enum untracked_status_type {
SHOW_NORMAL_UNTRACKED_FILES,
SHOW_ALL_UNTRACKED_FILES
};
extern enum untracked_status_type show_untracked_files;
struct wt_status_change_data {
int worktree_status;
@ -33,8 +32,12 @@ struct wt_status {
const char *reference;
int verbose;
int amend;
int untracked;
int nowarn;
int use_color;
int relative_paths;
int submodule_summary;
enum untracked_status_type show_untracked_files;
/* These are computed during processing of the individual sections */
int commitable;
int workdir_dirty;
@ -46,8 +49,6 @@ struct wt_status {
};
int git_status_config(const char *var, const char *value, void *cb);
extern int wt_status_use_color;
extern int wt_status_relative_paths;
void wt_status_prepare(struct wt_status *s);
void wt_status_print(struct wt_status *s);
void wt_status_collect_changes(struct wt_status *s);