mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
CommitView: Don't allow empty commits
This commit is contained in:
+10
-2
@@ -167,7 +167,15 @@
|
||||
|
||||
- (IBAction) commit:(id) sender
|
||||
{
|
||||
|
||||
if ([[cachedFilesController arrangedObjects] count] == 0) {
|
||||
[[NSAlert alertWithMessageText:@"No changes to commit"
|
||||
defaultButton:nil
|
||||
alternateButton:nil
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:@"You must first stage some changes before committing"] runModal];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *commitMessage = [commitMessageView string];
|
||||
if ([commitMessage length] < 3) {
|
||||
[[NSAlert alertWithMessageText:@"Commitmessage missing"
|
||||
@@ -177,7 +185,7 @@
|
||||
informativeTextWithFormat:@"Please enter a commit message before committing"] runModal];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
self.busy++;
|
||||
self.status = @"Creating tree..";
|
||||
NSString *tree = [repository outputForCommand:@"write-tree"];
|
||||
|
||||
Reference in New Issue
Block a user