diff --git a/dvc/command/check_ignore.py b/dvc/command/check_ignore.py index e28f4f19b4..97da662a35 100644 --- a/dvc/command/check_ignore.py +++ b/dvc/command/check_ignore.py @@ -38,12 +38,11 @@ def _check_one_file(self, target): def _interactive_mode(self): ret = 1 while True: - target = ask("") + try: + target = ask("") + except (KeyboardInterrupt, EOFError): + break if target == "": - logger.info( - "Empty string is not a valid pathspec. Please use . " - "instead if you meant to match all paths." - ) break if not self._check_one_file(target): ret = 0