git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
PRPavel Roskin <proski@gnu.org>
Date
Jan 24, 2006, 21:25 UTC
Message-ID
<1138137941.24415.33.camel@dv>
Otherwise, stg export fails with "list index out of range"
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 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
Message 1 of 1 in “stg export: check if there are any patches to export”
  1. stg export: check if there are any patches to exportPavel Roskin, Jan 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.