From 011cbd1b417a29bbcb189f86833bac773ba4a6f7 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Fri, 2 Sep 2005 11:25:27 +0200 Subject: [PATCH] [PATCH] Fix crash for empty description We access the last character of the description, which may be empty. Use slicing to avoid this crash. Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- stgit/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stgit/git.py b/stgit/git.py index c8339e0..40bcd78 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -299,7 +299,7 @@ def commit(message, files = [], parents = [], allowempty = False, # get the commit message f = file('.commitmsg', 'w+') - if message[-1] == '\n': + if message[-1:] == '\n': f.write(message) else: print >> f, message -- 2.11.0