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 <dstolee@microsoft.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Mar 27, 2020 at 00:48 UTC
cd002c15611a995a29b9e5881745bba402d63952
2 files changed
+7
-7
unpack-trees.c
+6
-6
@@ -43,15 +43,14 @@ static const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
43
/* ERROR_BIND_OVERLAP */
44
"Entry '%s' overlaps with '%s'. Cannot bind.",
45
46
+ /* ERROR_WOULD_LOSE_SUBMODULE */
47
+ "Submodule '%s' cannot checkout new HEAD.",
48
+
49
/* ERROR_SPARSE_NOT_UPTODATE_FILE */
50
"Entry '%s' not uptodate. Cannot update sparse checkout.",
51
52
/* ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN */
53
"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.",
54
};
55
56
#define ERRORMSG(o,type) \
@@ -166,12 +165,13 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
165
*/
166
msgs[ERROR_BIND_OVERLAP] = _("Entry '%s' overlaps with '%s'. Cannot bind.");
167
168
+ msgs[ERROR_WOULD_LOSE_SUBMODULE] =
169
+ _("Cannot update submodule:\n%s");
170
+
171
msgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =
172
_("Cannot update sparse checkout: the following entries are not up to date:\n%s");
173
msgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =
174
_("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");
175
176
opts->show_all_errors = 1;
177
/* rejected paths may not have a static buffer */
unpack-trees.h
+1
-1
@@ -22,9 +22,9 @@ enum unpack_trees_error_types {
22
ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN,
23
ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
24
ERROR_BIND_OVERLAP,
25
+ ERROR_WOULD_LOSE_SUBMODULE,
26
ERROR_SPARSE_NOT_UPTODATE_FILE,
27
ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
27
- ERROR_WOULD_LOSE_SUBMODULE,
28
NB_UNPACK_TREES_ERROR_TYPES
29
};
30