Thread (12 messages) flat view 12 messages, 2 authors, 2016-06-15
DORMANTno replies

[patch 08/11] Fix "stg clean" when stack is empty

From: Paolo 'Blaisorblade' Giarrusso <hidden>
Date: 2016-06-15 22:42:06
Subsystem: the rest · Maintainer: Linus Torvalds

From: Paolo 'Blaisorblade' Giarrusso <redacted>

It crashes on accessing 1st element of an empty array.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <redacted>
---

 stgit/commands/clean.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/stgit/commands/clean.py b/stgit/commands/clean.py
--- a/stgit/commands/clean.py
+++ b/stgit/commands/clean.py
@@ -65,7 +65,8 @@ def func(parser, options, args):
 
     if options.applied:
         applied = crt_series.get_applied()
-        crt_series.pop_patch(applied[0])
+        if applied != []:
+            crt_series.pop_patch(applied[0])
         __delete_empty(applied, True)
 
     if options.unapplied:
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help