From: Catalin Marinas Date: Sun, 11 Jun 2006 12:12:39 +0000 (+0100) Subject: Fix the add and rm commands to fail if no patch is applied X-Git-Tag: v0.14.3~480 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/cfe14b4f807febe8be658138b8565579ead331a2 Fix the add and rm commands to fail if no patch is applied They were just adding the file without complaining. Signed-off-by: Catalin Marinas --- diff --git a/stgit/commands/add.py b/stgit/commands/add.py index fc9c5a7..7f5a0b3 100644 --- a/stgit/commands/add.py +++ b/stgit/commands/add.py @@ -40,4 +40,7 @@ def func(parser, options, args): if len(args) < 1: parser.error('incorrect number of arguments') + if not crt_series.get_current(): + raise CmdException, 'No patches applied' + git.add(args) diff --git a/stgit/commands/rm.py b/stgit/commands/rm.py index 2005005..91908a1 100644 --- a/stgit/commands/rm.py +++ b/stgit/commands/rm.py @@ -41,4 +41,7 @@ def func(parser, options, args): if len(args) < 1: parser.error('incorrect number of arguments') + if not crt_series.get_current(): + raise CmdException, 'No patches applied' + git.rm(args, options.force)