Fix the import command when the body is empty
authorCatalin Marinas <catalin.marinas@gmail.com>
Tue, 20 Dec 2005 13:20:36 +0000 (13:20 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 21 Dec 2005 22:42:59 +0000 (22:42 +0000)
When the description doesn't have a body, the import command generates an
exception.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/imprt.py

index fdb91ea..6ccdcc9 100644 (file)
@@ -78,13 +78,11 @@ def __parse_description(descr):
     if not descr_lines:
         raise CmdException, "Empty patch description"
 
-    pos = -1
     lasthdr = 0
     end = len(descr_lines)
 
     # Parse the patch header
-    while pos < end:
-        pos += 1
+    for pos in range(0, end):
         if not descr_lines[pos]:
            continue
         # check for a "From|Author:" line