Skip to content

Commit 12d7914

Browse files
committed
Handle nonexistent files more nicely
Otherwise we get a whole backtrace which is alarming Signed-off-by: Ell Bradshaw <[email protected]>
1 parent 3528c65 commit 12d7914

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git-filter-repo

+6-1
Original file line numberDiff line numberDiff line change
@@ -4965,7 +4965,12 @@ class RepoFilter(object):
49654965

49664966
def main():
49674967
setup_gettext()
4968-
args = FilteringOptions.parse_args(sys.argv[1:])
4968+
try:
4969+
args = FilteringOptions.parse_args(sys.argv[1:])
4970+
except FileNotFoundError as e:
4971+
filename = e.filename.decode('utf-8') if type(e.filename) == bytes else e.filename
4972+
raise SystemExit(_("Error! Specified file '%s' does not exist") % filename)
4973+
49694974
if args.analyze:
49704975
RepoAnalyze.run(args)
49714976
else:

0 commit comments

Comments
 (0)