The manual and short help describe --error-unmatch as a check for
index membership. With --others, an untracked file satisfies the
check. With --modified, a tracked file with no unstaged changes
causes the command to exit with status 1.
Describe the check in terms of the paths selected by the other
options. Both cases are covered by t3005 and t3010.
Signed-off-by: Christian Sagstetter <chri…@gmail.com>
---
Documentation/git-ls-files.adoc | 5 +++--
builtin/ls-files.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-ls-files.adoc b/Documentation/git-ls-files.adoc
index 14ebad8b71..87b3b7f5e3 100644
--- a/Documentation/git-ls-files.adoc
+++ b/Documentation/git-ls-files.adoc
@@ -129,8 +129,9 @@ OPTIONS
in each directory, and the user's global exclusion file.
--error-unmatch::
- If any <file> does not appear in the index, treat this as an
- error (return 1).
+ If any <file> argument matches no path selected by the other
+ options, report an error and exit with status 1. For example,
+ `--others` checks for matches among untracked files.
--with-tree=<tree-ish>::
When using --error-unmatch to expand the user supplied
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index b044520f9e..af403b3f5e 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -651,7 +651,7 @@ int cmd_ls_files(int argc,
OPT_BOOL(0, "recurse-submodules", &recurse_submodules,
N_("recurse through submodules")),
OPT_BOOL(0, "error-unmatch", &error_unmatch,
- N_("if any <file> is not in the index, treat this as an error")),
+ N_("report an error if any pathspec matches no selected path")),
OPT_STRING(0, "with-tree", &with_tree, N_("tree-ish"),
N_("pretend that paths removed since <tree-ish> are still present")),
OPT__ABBREV(&abbrev),
base-commit: 566b6997dd4710b625c0882cf10a7443bf52d183
--
2.53.0