advice: keep config name in camelCase in advice_config[]

For parsing, we don't really need this because the main config parser will lowercase everything so we can do exact matching. But this array now is also used for printing in `git help --config`. Keep camelCase so we have a nice printout. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed May 26, 2018 at 15:55 UTC fb6fbffbdae719805fbf7a39ca268dad17696f82
1 file changed +21 -21
advice.c
+21 -21
@@ -54,28 +54,28 @@ static struct {
54 const char *name;
55 int *preference;
56 } advice_config[] = {
57 - { "pushupdaterejected", &advice_push_update_rejected },
58 - { "pushnonffcurrent", &advice_push_non_ff_current },
59 - { "pushnonffmatching", &advice_push_non_ff_matching },
60 - { "pushalreadyexists", &advice_push_already_exists },
61 - { "pushfetchfirst", &advice_push_fetch_first },
62 - { "pushneedsforce", &advice_push_needs_force },
63 - { "statushints", &advice_status_hints },
64 - { "statusuoption", &advice_status_u_option },
65 - { "commitbeforemerge", &advice_commit_before_merge },
66 - { "resolveconflict", &advice_resolve_conflict },
67 - { "implicitidentity", &advice_implicit_identity },
68 - { "detachedhead", &advice_detached_head },
69 - { "setupstreamfailure", &advice_set_upstream_failure },
70 - { "objectnamewarning", &advice_object_name_warning },
71 - { "rmhints", &advice_rm_hints },
72 - { "addembeddedrepo", &advice_add_embedded_repo },
73 - { "ignoredhook", &advice_ignored_hook },
74 - { "waitingforeditor", &advice_waiting_for_editor },
75 - { "graftfiledeprecated", &advice_graft_file_deprecated },
57 + { "pushUpdateRejected", &advice_push_update_rejected },
58 + { "pushNonFFCurrent", &advice_push_non_ff_current },
59 + { "pushNonFFMatching", &advice_push_non_ff_matching },
60 + { "pushAlreadyExists", &advice_push_already_exists },
61 + { "pushFetchFirst", &advice_push_fetch_first },
62 + { "pushNeedsForce", &advice_push_needs_force },
63 + { "statusHints", &advice_status_hints },
64 + { "statusUoption", &advice_status_u_option },
65 + { "commitBeforeMerge", &advice_commit_before_merge },
66 + { "resolveConflict", &advice_resolve_conflict },
67 + { "implicitIdentity", &advice_implicit_identity },
68 + { "detachedHead", &advice_detached_head },
69 + { "setupStreamFailure", &advice_set_upstream_failure },
70 + { "objectNameWarning", &advice_object_name_warning },
71 + { "rmHints", &advice_rm_hints },
72 + { "addEmbeddedRepo", &advice_add_embedded_repo },
73 + { "ignoredHook", &advice_ignored_hook },
74 + { "waitingForEditor", &advice_waiting_for_editor },
75 + { "graftFileDeprecated", &advice_graft_file_deprecated },
76
77 /* make this an alias for backward compatibility */
78 - { "pushnonfastforward", &advice_push_update_rejected }
78 + { "pushNonFastForward", &advice_push_update_rejected }
79 };
80
81 void advise(const char *advice, ...)
@@ -123,7 +123,7 @@ int git_default_advice_config(const char *var, const char *value)
123 return 0;
124
125 for (i = 0; i < ARRAY_SIZE(advice_config); i++) {
126 - if (strcmp(k, advice_config[i].name))
126 + if (strcasecmp(k, advice_config[i].name))
127 continue;
128 *advice_config[i].preference = git_config_bool(var, value);
129 return 0;