Skip to content

Commit 84a7f09

Browse files
stefanbellergitster
authored andcommitted
read-tree: use OPT_BOOL instead of OPT_SET_INT
All occurrences of OPT_SET_INT were setting the value to 1; internally OPT_BOOL is just that. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d7dffce commit 84a7f09

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

builtin/read-tree.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,34 +109,34 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
109109
{ OPTION_CALLBACK, 0, "index-output", NULL, N_("file"),
110110
N_("write resulting index to <file>"),
111111
PARSE_OPT_NONEG, index_output_cb },
112-
OPT_SET_INT(0, "empty", &read_empty,
113-
N_("only empty the index"), 1),
112+
OPT_BOOL(0, "empty", &read_empty,
113+
N_("only empty the index")),
114114
OPT__VERBOSE(&opts.verbose_update, N_("be verbose")),
115115
OPT_GROUP(N_("Merging")),
116-
OPT_SET_INT('m', NULL, &opts.merge,
117-
N_("perform a merge in addition to a read"), 1),
118-
OPT_SET_INT(0, "trivial", &opts.trivial_merges_only,
119-
N_("3-way merge if no file level merging required"), 1),
120-
OPT_SET_INT(0, "aggressive", &opts.aggressive,
121-
N_("3-way merge in presence of adds and removes"), 1),
122-
OPT_SET_INT(0, "reset", &opts.reset,
123-
N_("same as -m, but discard unmerged entries"), 1),
116+
OPT_BOOL('m', NULL, &opts.merge,
117+
N_("perform a merge in addition to a read")),
118+
OPT_BOOL(0, "trivial", &opts.trivial_merges_only,
119+
N_("3-way merge if no file level merging required")),
120+
OPT_BOOL(0, "aggressive", &opts.aggressive,
121+
N_("3-way merge in presence of adds and removes")),
122+
OPT_BOOL(0, "reset", &opts.reset,
123+
N_("same as -m, but discard unmerged entries")),
124124
{ OPTION_STRING, 0, "prefix", &opts.prefix, N_("<subdirectory>/"),
125125
N_("read the tree into the index under <subdirectory>/"),
126126
PARSE_OPT_NONEG | PARSE_OPT_LITERAL_ARGHELP },
127-
OPT_SET_INT('u', NULL, &opts.update,
128-
N_("update working tree with merge result"), 1),
127+
OPT_BOOL('u', NULL, &opts.update,
128+
N_("update working tree with merge result")),
129129
{ OPTION_CALLBACK, 0, "exclude-per-directory", &opts,
130130
N_("gitignore"),
131131
N_("allow explicitly ignored files to be overwritten"),
132132
PARSE_OPT_NONEG, exclude_per_directory_cb },
133-
OPT_SET_INT('i', NULL, &opts.index_only,
134-
N_("don't check the working tree after merging"), 1),
133+
OPT_BOOL('i', NULL, &opts.index_only,
134+
N_("don't check the working tree after merging")),
135135
OPT__DRY_RUN(&opts.dry_run, N_("don't update the index or the work tree")),
136-
OPT_SET_INT(0, "no-sparse-checkout", &opts.skip_sparse_checkout,
137-
N_("skip applying sparse checkout filter"), 1),
138-
OPT_SET_INT(0, "debug-unpack", &opts.debug_unpack,
139-
N_("debug unpack-trees"), 1),
136+
OPT_BOOL(0, "no-sparse-checkout", &opts.skip_sparse_checkout,
137+
N_("skip applying sparse checkout filter")),
138+
OPT_BOOL(0, "debug-unpack", &opts.debug_unpack,
139+
N_("debug unpack-trees")),
140140
OPT_END()
141141
};
142142

0 commit comments

Comments
 (0)