René Scharfe | 53a1116 | 2009-08-29 11:04:52 +0200 | [diff] [blame] | 1 | #include "cache.h" |
Brandon Williams | b2141fc | 2017-06-14 11:07:36 -0700 | [diff] [blame] | 2 | #include "config.h" |
René Scharfe | 53a1116 | 2009-08-29 11:04:52 +0200 | [diff] [blame] | 3 | #include "builtin.h" |
| 4 | #include "parse-options.h" |
| 5 | |
| 6 | static const char * const update_server_info_usage[] = { |
Nguyễn Thái Ngọc Duy | fb52a45 | 2012-08-20 19:32:50 +0700 | [diff] [blame] | 7 | N_("git update-server-info [--force]"), |
René Scharfe | 53a1116 | 2009-08-29 11:04:52 +0200 | [diff] [blame] | 8 | NULL |
| 9 | }; |
| 10 | |
| 11 | int cmd_update_server_info(int argc, const char **argv, const char *prefix) |
| 12 | { |
| 13 | int force = 0; |
| 14 | struct option options[] = { |
Nguyễn Thái Ngọc Duy | 1224781 | 2018-02-09 18:01:42 +0700 | [diff] [blame] | 15 | OPT__FORCE(&force, N_("update the info files from scratch"), 0), |
René Scharfe | 53a1116 | 2009-08-29 11:04:52 +0200 | [diff] [blame] | 16 | OPT_END() |
| 17 | }; |
| 18 | |
Nguyễn Thái Ngọc Duy | da591a7 | 2012-03-07 17:54:21 +0700 | [diff] [blame] | 19 | git_config(git_default_config, NULL); |
René Scharfe | 53a1116 | 2009-08-29 11:04:52 +0200 | [diff] [blame] | 20 | argc = parse_options(argc, argv, prefix, options, |
| 21 | update_server_info_usage, 0); |
| 22 | if (argc > 0) |
| 23 | usage_with_options(update_server_info_usage, options); |
| 24 | |
| 25 | return !!update_server_info(force); |
| 26 | } |