From: Catalin Marinas Date: Sun, 5 Feb 2006 10:31:27 +0000 (+0000) Subject: Check whether the file exists in the fold command X-Git-Tag: v0.14.3~547 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/0a01a6d0eaf0c6a70819da2f73fc659e7a83b569 Check whether the file exists in the fold command This is to avoid an error reported by GIT. Signed-off-by: Catalin Marinas --- diff --git a/stgit/commands/fold.py b/stgit/commands/fold.py index a9bb7fa..8b796ca 100644 --- a/stgit/commands/fold.py +++ b/stgit/commands/fold.py @@ -60,7 +60,10 @@ def func(parser, options, args): raise CmdException, 'No patches applied' if filename: - print 'Folding patch "%s"...' % filename, + if os.path.exists(filename): + print 'Folding patch "%s"...' % filename, + else: + raise CmdException, 'No such file: %s' % filename else: print 'Folding patch from stdin...', sys.stdout.flush()