git-svn: don't die on rebuild when --upgrade is specified
[git/gitweb.git] / builtin-runstatus.c
blob303c556da03664cdfe006525a95664e47c166805
1 #include "wt-status.h"
2 #include "cache.h"
4 extern int wt_status_use_color;
6 static const char runstatus_usage[] =
7 "git-runstatus [--color|--nocolor] [--amend] [--verbose]";
9 int cmd_runstatus(int argc, const char **argv, const char *prefix)
11 struct wt_status s;
12 int i;
14 git_config(git_status_config);
15 wt_status_prepare(&s);
17 for (i = 1; i < argc; i++) {
18 if (!strcmp(argv[i], "--color"))
19 wt_status_use_color = 1;
20 else if (!strcmp(argv[i], "--nocolor"))
21 wt_status_use_color = 0;
22 else if (!strcmp(argv[i], "--amend")) {
23 s.amend = 1;
24 s.reference = "HEAD^1";
26 else if (!strcmp(argv[i], "--verbose"))
27 s.verbose = 1;
28 else if (!strcmp(argv[i], "--untracked"))
29 s.untracked = 1;
30 else
31 usage(runstatus_usage);
34 wt_status_print(&s);
35 return s.commitable ? 0 : 1;