push: make non-fast-forward help message configurable
[git/srabbelier.git] / advice.c
blobb5216a2456f3f1d4e1d0bf582e3a735672217e35
1 #include "cache.h"
3 int advice_push_nonfastforward = 1;
5 static struct {
6 const char *name;
7 int *preference;
8 } advice_config[] = {
9 { "pushnonfastforward", &advice_push_nonfastforward },
12 int git_default_advice_config(const char *var, const char *value)
14 const char *k = skip_prefix(var, "advice.");
15 int i;
17 for (i = 0; i < ARRAY_SIZE(advice_config); i++) {
18 if (strcmp(k, advice_config[i].name))
19 continue;
20 *advice_config[i].preference = git_config_bool(var, value);
21 return 0;
24 return 0;