mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
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:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user