DORMANTno replies

[PATCH] stg export: check if there are any patches to export

From: Pavel Roskin <hidden>
Date: 2016-06-15 22:42:17
Subsystem: the rest · Maintainer: Linus Torvalds

Otherwise, stg export fails with "list index out of range"

Signed-off-by: Pavel Roskin <redacted>
---

 stgit/commands/export.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/stgit/commands/export.py b/stgit/commands/export.py
index 096fb68..b8ca133 100644
--- a/stgit/commands/export.py
+++ b/stgit/commands/export.py
@@ -124,6 +124,9 @@ def func(parser, options, args):
     patches = applied[start_idx:stop_idx]
 
     num = len(patches)
+    if num == 0:
+        raise CmdException, 'No patches applied'
+
     zpadding = len(str(num))
     if zpadding < 2:
         zpadding = 2

-- 
Regards,
Pavel Roskin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help