summaryrefslogtreecommitdiffstats
path: root/wt-status.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-03-13 18:32:13 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-13 18:43:32 +0100
commit63acdc4827869a6cedd46aca62e16819498c53fb (patch)
tree08769acb5146c3fcc47dff14b6c7cedac6e2f264 /wt-status.h
parentThe sixth batch (diff)
downloadgit-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.h3
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
};