aboutsummaryrefslogtreecommitdiff
path: root/update-server-info.c
blob: 7b38fd867bba6f8b8dcf9f2094769314b7f23e02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "cache.h"
#include "exec_cmd.h"

static const char update_server_info_usage[] =
"git update-server-info [--force]";

int main(int ac, char **av)
{
	int i;
	int force = 0;
	for (i = 1; i < ac; i++) {
		if (av[i][0] == '-') {
			if (!strcmp("--force", av[i]) ||
			    !strcmp("-f", av[i]))
				force = 1;
			else
				usage(update_server_info_usage);
		}
	}
	if (i != ac)
		usage(update_server_info_usage);

	git_extract_argv0_path(av[0]);

	setup_git_directory();

	return !!update_server_info(force);
}