Fix the add and rm commands to fail if no patch is applied
[stgit] / stgit / commands / add.py
index 999ce2b..7f5a0b3 100644 (file)
@@ -27,7 +27,7 @@ from stgit import stack, git
 help = 'add files or directories to the repository'
 usage = """%prog [options] <files/dirs...>
 
-Add the files or directories passed as arguments to the
+Add the files or directories passed as arguments to the
 repository. When a directory name is given, all the files and
 subdirectories are recursively added."""
 
@@ -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)