CommitView: Don't break on oneliners

e2210f7306e4c1647ff068f660db1674ce0391e1 (CommitView: Add a better reflog entry)
created a bug where an exception was thrown if you enter a one-lined commit
message.
This commit is contained in:
Pieter de Bie
2008-10-09 12:43:24 +02:00
parent 64f1957ec9
commit 69e1c6fc45
+5 -3
View File
@@ -222,10 +222,12 @@
return;
}
NSString *commitSubject = [commitMessage substringToIndex:
[commitMessage rangeOfString:@"\n"].location];
if (!commitSubject)
NSString *commitSubject;
NSRange newLine = [commitMessage rangeOfString:@"\n"];
if (newLine.location == NSNotFound)
commitSubject = commitMessage;
else
commitSubject = [commitMessage substringToIndex:newLine.location];
commitSubject = [@"commit: " stringByAppendingString:commitSubject];