summaryrefslogtreecommitdiff
path: root/advice.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-26 15:55:26 +0200
committerJunio C Hamano <gitster@pobox.com>2018-05-29 14:51:28 +0900
commitfb6fbffbdae719805fbf7a39ca268dad17696f82 (patch)
tree6cf8a27bc56db0d85fd433f32992339dff16f7ab /advice.c
parenta4a9cc19a29df22f367fde50eec046ba6c5533f6 (diff)
downloadgit-fb6fbffbdae719805fbf7a39ca268dad17696f82.tar.gz
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>
Diffstat (limited to 'advice.c')
-rw-r--r--advice.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/advice.c b/advice.c
index cf6c673ed7..2aca11f45e 100644
--- a/advice.c
+++ b/advice.c
@@ -54,28 +54,28 @@ static struct {
const char *name;
int *preference;
} advice_config[] = {
- { "pushupdaterejected", &advice_push_update_rejected },
- { "pushnonffcurrent", &advice_push_non_ff_current },
- { "pushnonffmatching", &advice_push_non_ff_matching },
- { "pushalreadyexists", &advice_push_already_exists },
- { "pushfetchfirst", &advice_push_fetch_first },
- { "pushneedsforce", &advice_push_needs_force },
- { "statushints", &advice_status_hints },
- { "statusuoption", &advice_status_u_option },
- { "commitbeforemerge", &advice_commit_before_merge },
- { "resolveconflict", &advice_resolve_conflict },
- { "implicitidentity", &advice_implicit_identity },
- { "detachedhead", &advice_detached_head },
- { "setupstreamfailure", &advice_set_upstream_failure },
- { "objectnamewarning", &advice_object_name_warning },
- { "rmhints", &advice_rm_hints },
- { "addembeddedrepo", &advice_add_embedded_repo },
- { "ignoredhook", &advice_ignored_hook },
- { "waitingforeditor", &advice_waiting_for_editor },
- { "graftfiledeprecated", &advice_graft_file_deprecated },
+ { "pushUpdateRejected", &advice_push_update_rejected },
+ { "pushNonFFCurrent", &advice_push_non_ff_current },
+ { "pushNonFFMatching", &advice_push_non_ff_matching },
+ { "pushAlreadyExists", &advice_push_already_exists },
+ { "pushFetchFirst", &advice_push_fetch_first },
+ { "pushNeedsForce", &advice_push_needs_force },
+ { "statusHints", &advice_status_hints },
+ { "statusUoption", &advice_status_u_option },
+ { "commitBeforeMerge", &advice_commit_before_merge },
+ { "resolveConflict", &advice_resolve_conflict },
+ { "implicitIdentity", &advice_implicit_identity },
+ { "detachedHead", &advice_detached_head },
+ { "setupStreamFailure", &advice_set_upstream_failure },
+ { "objectNameWarning", &advice_object_name_warning },
+ { "rmHints", &advice_rm_hints },
+ { "addEmbeddedRepo", &advice_add_embedded_repo },
+ { "ignoredHook", &advice_ignored_hook },
+ { "waitingForEditor", &advice_waiting_for_editor },
+ { "graftFileDeprecated", &advice_graft_file_deprecated },
/* make this an alias for backward compatibility */
- { "pushnonfastforward", &advice_push_update_rejected }
+ { "pushNonFastForward", &advice_push_update_rejected }
};
void advise(const char *advice, ...)
@@ -123,7 +123,7 @@ int git_default_advice_config(const char *var, const char *value)
return 0;
for (i = 0; i < ARRAY_SIZE(advice_config); i++) {
- if (strcmp(k, advice_config[i].name))
+ if (strcasecmp(k, advice_config[i].name))
continue;
*advice_config[i].preference = git_config_bool(var, value);
return 0;