From 0a01a6d0eaf0c6a70819da2f73fc659e7a83b569 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Sun, 5 Feb 2006 10:31:27 +0000 Subject: [PATCH] Check whether the file exists in the fold command This is to avoid an error reported by GIT. Signed-off-by: Catalin Marinas --- stgit/commands/fold.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() -- 2.11.0