diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-03-13 18:32:13 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-03-13 18:43:32 +0100 |
commit | 63acdc4827869a6cedd46aca62e16819498c53fb (patch) | |
tree | 08769acb5146c3fcc47dff14b6c7cedac6e2f264 /wt-status.h | |
parent | The sixth batch (diff) | |
download | git-63acdc4827869a6cedd46aca62e16819498c53fb.tar.xz git-63acdc4827869a6cedd46aca62e16819498c53fb.zip |
status: unify parsing of --untracked= and status.showUntrackedFiles
There are two code paths that take a string and parse it to enum
untracked_status_type. Introduce a helper function and use it.
As these two places handle an error differently, add an additional
invalid value to the enum, and have the caller of the helper handle
the error condition, instead of dying or emitting error message from
the helper.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.h')
-rw-r--r-- | wt-status.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wt-status.h b/wt-status.h index 5e99ba4707..4e377ce62b 100644 --- a/wt-status.h +++ b/wt-status.h @@ -23,7 +23,8 @@ enum color_wt_status { }; enum untracked_status_type { - SHOW_NO_UNTRACKED_FILES, + SHOW_UNTRACKED_FILES_ERROR = -1, + SHOW_NO_UNTRACKED_FILES = 0, SHOW_NORMAL_UNTRACKED_FILES, SHOW_ALL_UNTRACKED_FILES }; |