Skip to content

Commit fb6fbff

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a4a9cc1 commit fb6fbff

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

advice.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,28 @@ static struct {
5454
const char *name;
5555
int *preference;
5656
} 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 },
7676

7777
/* make this an alias for backward compatibility */
78-
{ "pushnonfastforward", &advice_push_update_rejected }
78+
{ "pushNonFastForward", &advice_push_update_rejected }
7979
};
8080

8181
void advise(const char *advice, ...)
@@ -123,7 +123,7 @@ int git_default_advice_config(const char *var, const char *value)
123123
return 0;
124124

125125
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))
127127
continue;
128128
*advice_config[i].preference = git_config_bool(var, value);
129129
return 0;

0 commit comments

Comments
 (0)