Staging
v0.5.1
Revision 6c2f207b2316149ee8dfaf026e4a869ff9ab42f7 authored by Shawn O. Pearce on 05 November 2006, 05:37:23 UTC, committed by Junio C Hamano on 05 November 2006, 07:48:36 UTC
At least one older version of the Solaris C compiler doesn't support
the newer C99 style struct initializers.  To allow Git to compile
on those systems use an archive description struct which is easier
to initialize without the C99 struct initializer syntax.

Also since the archives array is not used by anyone other than
archive.c we can make it static.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent af8ffbe
Raw File
builtin-runstatus.c
#include "wt-status.h"
#include "cache.h"

extern int wt_status_use_color;

static const char runstatus_usage[] =
"git-runstatus [--color|--nocolor] [--amend] [--verbose]";

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;
}
back to top