From d6ccf34881d1c178d4def0dfc9797d9d0fdb3ef0 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sat, 20 Jun 2009 21:10:38 +0100 Subject: [PATCH] CommitController: Reject merges We don't support this in any way yet, so let's just issue a warning rather than failing silently --- PBGitCommitController.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PBGitCommitController.m b/PBGitCommitController.m index f41ffe2..d74e2a5 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -318,6 +318,11 @@ - (IBAction) commit:(id) sender { + if ([[NSFileManager defaultManager] fileExistsAtPath:[repository.fileURL.path stringByAppendingPathComponent:@"MERGE_HEAD"]]) { + [[repository windowController] showMessageSheet:@"Cannot commit merges" infoText:@"GitX cannot commit merges yet. Please commit your changes from the command line."]; + return; + } + if ([[cachedFilesController arrangedObjects] count] == 0) { [[repository windowController] showMessageSheet:@"No changes to commit" infoText:@"You must first stage some changes before committing"]; return;