From cfe14b4f807febe8be658138b8565579ead331a2 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Sun, 11 Jun 2006 13:12:39 +0100 Subject: [PATCH] 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 --- stgit/commands/add.py | 3 +++ stgit/commands/rm.py | 3 +++ 2 files changed, 6 insertions(+) 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) -- 2.11.0