diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-04-29 14:21:28 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-29 14:21:28 -0700 |
| commit | 5a6de390d8a844bb9c6e192cd79ed6a33c1f5d14 (patch) | |
| tree | 2dff2c6681a6f23514e7293de48bff670916eaeb /builtin | |
| parent | Merge branch 'as/typofix-in-env-h-header' (diff) | |
| parent | global: mark usage strings and string tables const (diff) | |
| download | git-5a6de390d8a844bb9c6e192cd79ed6a33c1f5d14.tar.gz git-5a6de390d8a844bb9c6e192cd79ed6a33c1f5d14.zip | |
Merge branch 'az/tighten-string-array-constness'
Code clean-up.
* az/tighten-string-array-constness:
global: mark usage strings and string tables const
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/blame.c | 10 | ||||
| -rw-r--r-- | builtin/commit-graph.c | 4 | ||||
| -rw-r--r-- | builtin/fast-export.c | 2 | ||||
| -rw-r--r-- | builtin/mktree.c | 2 | ||||
| -rw-r--r-- | builtin/pack-objects.c | 2 | ||||
| -rw-r--r-- | builtin/show-branch.c | 2 |
6 files changed, 11 insertions, 11 deletions
diff --git a/builtin/blame.c b/builtin/blame.c index 5bf11c2a3c..944952e30e 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -36,17 +36,17 @@ #include "tag.h" #include "write-or-die.h" -static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"); -static char annotate_usage[] = N_("git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"); +static const char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"); +static const char annotate_usage[] = N_("git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"); -static const char *blame_opt_usage[] = { +static const char *const blame_opt_usage[] = { blame_usage, "", N_("<rev-opts> are documented in git-rev-list(1)"), NULL }; -static const char *annotate_opt_usage[] = { +static const char *const annotate_opt_usage[] = { annotate_usage, "", N_("<rev-opts> are documented in git-rev-list(1)"), @@ -944,7 +944,7 @@ int cmd_blame(int argc, long anchor; long num_lines = 0; const char *str_usage = cmd_is_annotate ? annotate_usage : blame_usage; - const char **opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage; + const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage; setup_default_color_by_age(); git_config(git_blame_config, &output_option); diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index be06d0a811..a783a86e79 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -22,12 +22,12 @@ " [--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]\n" \ " <split-options>") -static const char * builtin_commit_graph_verify_usage[] = { +static const char * const builtin_commit_graph_verify_usage[] = { BUILTIN_COMMIT_GRAPH_VERIFY_USAGE, NULL }; -static const char * builtin_commit_graph_write_usage[] = { +static const char * const builtin_commit_graph_write_usage[] = { BUILTIN_COMMIT_GRAPH_WRITE_USAGE, NULL }; diff --git a/builtin/fast-export.c b/builtin/fast-export.c index afacd228b5..37c01d6c6f 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -30,7 +30,7 @@ #include "remote.h" #include "blob.h" -static const char *fast_export_usage[] = { +static const char *const fast_export_usage[] = { N_("git fast-export [<rev-list-opts>]"), NULL }; diff --git a/builtin/mktree.c b/builtin/mktree.c index 7ffe6eefd8..4b47803467 100644 --- a/builtin/mktree.c +++ b/builtin/mktree.c @@ -67,7 +67,7 @@ static void write_tree(struct object_id *oid) strbuf_release(&buf); } -static const char *mktree_usage[] = { +static const char *const mktree_usage[] = { "git mktree [-z] [--missing] [--batch]", NULL }; diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 72ebe13fe0..8b33edc2ff 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -183,7 +183,7 @@ static inline void oe_set_delta_size(struct packing_data *pack, #define SET_DELTA_CHILD(obj, val) oe_set_delta_child(&to_pack, obj, val) #define SET_DELTA_SIBLING(obj, val) oe_set_delta_sibling(&to_pack, obj, val) -static const char *pack_usage[] = { +static const char *const pack_usage[] = { N_("git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"), N_("git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"), NULL diff --git a/builtin/show-branch.c b/builtin/show-branch.c index b549d8c3f5..525b231d87 100644 --- a/builtin/show-branch.c +++ b/builtin/show-branch.c @@ -19,7 +19,7 @@ #include "date.h" #include "wildmatch.h" -static const char* show_branch_usage[] = { +static const char*const show_branch_usage[] = { N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n" " [--current] [--color[=<when>] | --no-color] [--sparse]\n" " [--more=<n> | --list | --independent | --merge-base]\n" |
