Skip to content

Commit f51faf3

Browse files
authored
Merge branch 'gvfs-2.18.0' into gvfs-serialize-status-rename
2 parents 4bbb17a + 2c01101 commit f51faf3

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

builtin/config.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int show_origin;
6767
{ OPTION_CALLBACK, (s), (l), (v), NULL, (h), PARSE_OPT_NOARG | \
6868
PARSE_OPT_NONEG, option_parse_type, (i) }
6969

70-
static struct option builtin_config_options[];
70+
static NORETURN void usage_builtin_config(void);
7171

7272
static int option_parse_type(const struct option *opt, const char *arg,
7373
int unset)
@@ -111,8 +111,7 @@ static int option_parse_type(const struct option *opt, const char *arg,
111111
* --type=int'.
112112
*/
113113
error("only one type at a time.");
114-
usage_with_options(builtin_config_usage,
115-
builtin_config_options);
114+
usage_builtin_config();
116115
}
117116
*to_type = new_type;
118117

@@ -157,11 +156,16 @@ static struct option builtin_config_options[] = {
157156
OPT_END(),
158157
};
159158

159+
static NORETURN void usage_builtin_config(void)
160+
{
161+
usage_with_options(builtin_config_usage, builtin_config_options);
162+
}
163+
160164
static void check_argc(int argc, int min, int max) {
161165
if (argc >= min && argc <= max)
162166
return;
163167
error("wrong number of arguments");
164-
usage_with_options(builtin_config_usage, builtin_config_options);
168+
usage_builtin_config();
165169
}
166170

167171
static void show_config_origin(struct strbuf *buf)
@@ -596,7 +600,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
596600
if (use_global_config + use_system_config + use_local_config +
597601
!!given_config_source.file + !!given_config_source.blob > 1) {
598602
error("only one config file at a time.");
599-
usage_with_options(builtin_config_usage, builtin_config_options);
603+
usage_builtin_config();
600604
}
601605

602606
if (use_local_config && nongit)
@@ -660,38 +664,37 @@ int cmd_config(int argc, const char **argv, const char *prefix)
660664

661665
if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && type) {
662666
error("--get-color and variable type are incoherent");
663-
usage_with_options(builtin_config_usage, builtin_config_options);
667+
usage_builtin_config();
664668
}
665669

666670
if (HAS_MULTI_BITS(actions)) {
667671
error("only one action at a time.");
668-
usage_with_options(builtin_config_usage, builtin_config_options);
672+
usage_builtin_config();
669673
}
670674
if (actions == 0)
671675
switch (argc) {
672676
case 1: actions = ACTION_GET; break;
673677
case 2: actions = ACTION_SET; break;
674678
case 3: actions = ACTION_SET_ALL; break;
675679
default:
676-
usage_with_options(builtin_config_usage, builtin_config_options);
680+
usage_builtin_config();
677681
}
678682
if (omit_values &&
679683
!(actions == ACTION_LIST || actions == ACTION_GET_REGEXP)) {
680684
error("--name-only is only applicable to --list or --get-regexp");
681-
usage_with_options(builtin_config_usage, builtin_config_options);
685+
usage_builtin_config();
682686
}
683687

684688
if (show_origin && !(actions &
685689
(ACTION_GET|ACTION_GET_ALL|ACTION_GET_REGEXP|ACTION_LIST))) {
686690
error("--show-origin is only applicable to --get, --get-all, "
687691
"--get-regexp, and --list.");
688-
usage_with_options(builtin_config_usage, builtin_config_options);
692+
usage_builtin_config();
689693
}
690694

691695
if (default_value && !(actions & ACTION_GET)) {
692696
error("--default is only applicable to --get");
693-
usage_with_options(builtin_config_usage,
694-
builtin_config_options);
697+
usage_builtin_config();
695698
}
696699

697700
if (actions & PAGING_ACTIONS)

convert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static void trace_encoding(const char *context, const char *path,
335335
strbuf_addf(&trace, "%s (%s, considered %s):\n", context, path, encoding);
336336
for (i = 0; i < len && buf; ++i) {
337337
strbuf_addf(
338-
&trace,"| \e[2m%2i:\e[0m %2x \e[2m%c\e[0m%c",
338+
&trace, "| \033[2m%2i:\033[0m %2x \033[2m%c\033[0m%c",
339339
i,
340340
(unsigned char) buf[i],
341341
(buf[i] > 32 && buf[i] < 127 ? buf[i] : ' '),

0 commit comments

Comments
 (0)