Skip to content

Commit 2243d22

Browse files
committed
Merge branch 'sb/unpack-trees-super-prefix'
"git read-tree" and its underlying unpack_trees() machinery learned to report problematic paths prefixed with the --super-prefix option. * sb/unpack-trees-super-prefix: unpack-trees: support super-prefix option t1001: modernize style t1000: modernize style read-tree: use OPT_BOOL instead of OPT_SET_INT
2 parents 8a8f121 + 3d41542 commit 2243d22

File tree

5 files changed

+702
-676
lines changed

5 files changed

+702
-676
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

git.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static struct cmd_struct commands[] = {
472472
{ "prune-packed", cmd_prune_packed, RUN_SETUP },
473473
{ "pull", cmd_pull, RUN_SETUP | NEED_WORK_TREE },
474474
{ "push", cmd_push, RUN_SETUP },
475-
{ "read-tree", cmd_read_tree, RUN_SETUP },
475+
{ "read-tree", cmd_read_tree, RUN_SETUP | SUPPORT_SUPER_PREFIX},
476476
{ "receive-pack", cmd_receive_pack },
477477
{ "reflog", cmd_reflog, RUN_SETUP },
478478
{ "remote", cmd_remote, RUN_SETUP },

0 commit comments

Comments
 (0)