GIT 1.6.5
[git/git.git] / advice.c
CommitLineData
75194438
JK
1#include "cache.h"
2
3int advice_push_nonfastforward = 1;
edf563fb 4int advice_status_hints = 1;
75194438
JK
5
6static struct {
7 const char *name;
8 int *preference;
9} advice_config[] = {
10 { "pushnonfastforward", &advice_push_nonfastforward },
edf563fb 11 { "statushints", &advice_status_hints },
75194438
JK
12};
13
14int git_default_advice_config(const char *var, const char *value)
15{
16 const char *k = skip_prefix(var, "advice.");
17 int i;
18
19 for (i = 0; i < ARRAY_SIZE(advice_config); i++) {
20 if (strcmp(k, advice_config[i].name))
21 continue;
22 *advice_config[i].preference = git_config_bool(var, value);
23 return 0;
24 }
25
26 return 0;
27}