diff options
author | Elijah Newren <newren@gmail.com> | 2020-03-27 01:48:57 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-27 19:33:30 +0100 |
commit | 6271d77cb1ccfb7e4124593b4463446fe1188cda (patch) | |
tree | c61eaeac3a59e827ddf48beb78aee8716f74b367 /unpack-trees.h | |
parent | unpack-trees: rename ERROR_* fields meant for warnings to WARNING_* (diff) | |
download | git-6271d77cb1ccfb7e4124593b4463446fe1188cda.tar.xz git-6271d77cb1ccfb7e4124593b4463446fe1188cda.zip |
unpack-trees: split display_error_msgs() into two
display_error_msgs() is never called to show messages of both ERROR_*
and WARNING_* types at the same time; it is instead called multiple
times, separately for each type. Since we want to display these types
differently, make two slightly different versions of this function.
A subsequent commit will further modify unpack_trees() and how it calls
the new display_warning_msgs().
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.h')
-rw-r--r-- | unpack-trees.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/unpack-trees.h b/unpack-trees.h index aac1ad4b01..dae948205f 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -24,10 +24,12 @@ enum unpack_trees_error_types { ERROR_BIND_OVERLAP, ERROR_WOULD_LOSE_SUBMODULE, + NB_UNPACK_TREES_ERROR_TYPES, + WARNING_SPARSE_NOT_UPTODATE_FILE, WARNING_SPARSE_ORPHANED_NOT_OVERWRITTEN, - NB_UNPACK_TREES_ERROR_TYPES, + NB_UNPACK_TREES_WARNING_TYPES, }; /* @@ -66,13 +68,13 @@ struct unpack_trees_options { struct dir_struct *dir; struct pathspec *pathspec; merge_fn_t fn; - const char *msgs[NB_UNPACK_TREES_ERROR_TYPES]; + const char *msgs[NB_UNPACK_TREES_WARNING_TYPES]; struct argv_array msgs_to_free; /* * Store error messages in an array, each case * corresponding to a error message type */ - struct string_list unpack_rejects[NB_UNPACK_TREES_ERROR_TYPES]; + struct string_list unpack_rejects[NB_UNPACK_TREES_WARNING_TYPES]; int head_idx; int merge_size; |