unpack-trees: move ERROR_WOULD_LOSE_SUBMODULE earlier
authorElijah Newren <redacted>
Fri, 27 Mar 2020 00:48:55 +0000 (00:48 +0000)
committerJunio C Hamano <redacted>
Fri, 27 Mar 2020 18:33:30 +0000 (11:33 -0700)
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 <redacted>
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
unpack-trees.c
unpack-trees.h

index a5bc0a3a16d540cc0274bd0c8768e6598e865701..eeac309e30e570b6a6d2676e56a0ac160a9bb6ec 100644 (file)
@@ -43,15 +43,14 @@ static const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
        /* ERROR_BIND_OVERLAP */
        "Entry '%s' overlaps with '%s'.  Cannot bind.",
 
+       /* ERROR_WOULD_LOSE_SUBMODULE */
+       "Submodule '%s' cannot checkout new HEAD.",
+
        /* ERROR_SPARSE_NOT_UPTODATE_FILE */
        "Entry '%s' not uptodate. Cannot update sparse checkout.",
 
        /* ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN */
        "Working tree file '%s' would be overwritten by sparse checkout update.",
-
-
-       /* ERROR_WOULD_LOSE_SUBMODULE */
-       "Submodule '%s' cannot checkout new HEAD.",
 };
 
 #define ERRORMSG(o,type) \
@@ -166,12 +165,13 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
         */
        msgs[ERROR_BIND_OVERLAP] = _("Entry '%s' overlaps with '%s'.  Cannot bind.");
 
+       msgs[ERROR_WOULD_LOSE_SUBMODULE] =
+               _("Cannot update submodule:\n%s");
+
        msgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =
                _("Cannot update sparse checkout: the following entries are not up to date:\n%s");
        msgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =
                _("The following working tree files would be overwritten by sparse checkout update:\n%s");
-       msgs[ERROR_WOULD_LOSE_SUBMODULE] =
-               _("Cannot update submodule:\n%s");
 
        opts->show_all_errors = 1;
        /* rejected paths may not have a static buffer */
index 5cf41ef5b53a65463ad50c6bbb06a63f20acfaaf..3e996a6c0a9fbfced7bf2eb53638c7df3cd4800f 100644 (file)
@@ -22,9 +22,9 @@ enum unpack_trees_error_types {
        ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN,
        ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
        ERROR_BIND_OVERLAP,
+       ERROR_WOULD_LOSE_SUBMODULE,
        ERROR_SPARSE_NOT_UPTODATE_FILE,
        ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
-       ERROR_WOULD_LOSE_SUBMODULE,
        NB_UNPACK_TREES_ERROR_TYPES
 };
 
git clone https://git.99rst.org/PROJECT