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