mirror of
https://github.com/git/git.git
synced 2024-11-18 21:04:13 +01:00
85023577a8
This is a mechanical clean-up of the way *.c files include system header files. (1) sources under compat/, platform sha-1 implementations, and xdelta code are exempt from the following rules; (2) the first #include must be "git-compat-util.h" or one of our own header file that includes it first (e.g. config.h, builtin.h, pkt-line.h); (3) system headers that are included in "git-compat-util.h" need not be included in individual C source files. (4) "git-compat-util.h" does not have to include subsystem specific header files (e.g. expat.h). Signed-off-by: Junio C Hamano <junkio@cox.net>
37 lines
812 B
C
37 lines
812 B
C
#include "cache.h"
|
|
#include "wt-status.h"
|
|
|
|
extern int wt_status_use_color;
|
|
|
|
static const char runstatus_usage[] =
|
|
"git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]";
|
|
|
|
int cmd_runstatus(int argc, const char **argv, const char *prefix)
|
|
{
|
|
struct wt_status s;
|
|
int i;
|
|
|
|
git_config(git_status_config);
|
|
wt_status_prepare(&s);
|
|
|
|
for (i = 1; i < argc; i++) {
|
|
if (!strcmp(argv[i], "--color"))
|
|
wt_status_use_color = 1;
|
|
else if (!strcmp(argv[i], "--nocolor"))
|
|
wt_status_use_color = 0;
|
|
else if (!strcmp(argv[i], "--amend")) {
|
|
s.amend = 1;
|
|
s.reference = "HEAD^1";
|
|
}
|
|
else if (!strcmp(argv[i], "--verbose"))
|
|
s.verbose = 1;
|
|
else if (!strcmp(argv[i], "--untracked"))
|
|
s.untracked = 1;
|
|
else
|
|
usage(runstatus_usage);
|
|
}
|
|
|
|
wt_status_print(&s);
|
|
return s.commitable ? 0 : 1;
|
|
}
|