Web lists-archives.com

[PATCH 6/6] Handle unsupported combination status arguments




From: Jameson Miller <jamill@xxxxxxxxxxxxx>

It is not clear what the correct behavior should be when you ask for
specific ignored behavior without reporting untracked files. For now,
report this as an unsupported combination of input arguments, so it
can be modified in the future without back compat concerns.

Signed-off-by: Jameson Miller <jamill@xxxxxxxxxxxxx>
---
 builtin/commit.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/builtin/commit.c b/builtin/commit.c
index 34443b45d3..7812e106ad 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1400,6 +1400,11 @@ int cmd_status(int argc, const char **argv, const char *prefix)
 	handle_untracked_files_arg(&s);
 	handle_ignored_arg(&s);
 
+	/* Check for unsupported combination of args */
+	if (s.show_ignored_mode == SHOW_MATCHING_IGNORED &&
+	    s.show_untracked_files == SHOW_NO_UNTRACKED_FILES)
+		die(_("Unsupported combination of ignored and untracked-files arguments"));
+
 	parse_pathspec(&s.pathspec, 0,
 		       PATHSPEC_PREFER_FULL,
 		       prefix, argv);
-- 
2.13.6