Skip to content

Commit cd002c1

Browse files
newrengitster
authored andcommitted
unpack-trees: move ERROR_WOULD_LOSE_SUBMODULE earlier
A minor change, but we want to convert the sparse messages to warnings and this allows us to group warnings and errors. Reviewed-by: Derrick Stolee <[email protected]> Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4ee5d50 commit cd002c1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

unpack-trees.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ static const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
4343
/* ERROR_BIND_OVERLAP */
4444
"Entry '%s' overlaps with '%s'. Cannot bind.",
4545

46+
/* ERROR_WOULD_LOSE_SUBMODULE */
47+
"Submodule '%s' cannot checkout new HEAD.",
48+
4649
/* ERROR_SPARSE_NOT_UPTODATE_FILE */
4750
"Entry '%s' not uptodate. Cannot update sparse checkout.",
4851

4952
/* ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN */
5053
"Working tree file '%s' would be overwritten by sparse checkout update.",
51-
52-
53-
/* ERROR_WOULD_LOSE_SUBMODULE */
54-
"Submodule '%s' cannot checkout new HEAD.",
5554
};
5655

5756
#define ERRORMSG(o,type) \
@@ -166,12 +165,13 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
166165
*/
167166
msgs[ERROR_BIND_OVERLAP] = _("Entry '%s' overlaps with '%s'. Cannot bind.");
168167

168+
msgs[ERROR_WOULD_LOSE_SUBMODULE] =
169+
_("Cannot update submodule:\n%s");
170+
169171
msgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =
170172
_("Cannot update sparse checkout: the following entries are not up to date:\n%s");
171173
msgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =
172174
_("The following working tree files would be overwritten by sparse checkout update:\n%s");
173-
msgs[ERROR_WOULD_LOSE_SUBMODULE] =
174-
_("Cannot update submodule:\n%s");
175175

176176
opts->show_all_errors = 1;
177177
/* rejected paths may not have a static buffer */

unpack-trees.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ enum unpack_trees_error_types {
2222
ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN,
2323
ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
2424
ERROR_BIND_OVERLAP,
25+
ERROR_WOULD_LOSE_SUBMODULE,
2526
ERROR_SPARSE_NOT_UPTODATE_FILE,
2627
ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
27-
ERROR_WOULD_LOSE_SUBMODULE,
2828
NB_UNPACK_TREES_ERROR_TYPES
2929
};
3030

0 commit comments

Comments
 (0)