Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only require commit message to be non-empty #361

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Classes/Controllers/PBGitCommitController.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ - (void) commitWithVerification:(BOOL) doVerify
}

NSString *commitMessage = [commitMessageView string];
if ([commitMessage length] < 3) {
if ([commitMessage length] == 0) {
[[repository windowController] showMessageSheet:@"Commitmessage missing" infoText:@"Please enter a commit message before committing"];
return;
}
Expand Down Expand Up @@ -213,9 +213,8 @@ - (void)commitHookFailed:(NSNotification *)notification

- (void)amendCommit:(NSNotification *)notification
{
// Replace commit message with the old one if it's less than 3 characters long.
// This is just a random number.
if ([[commitMessageView string] length] > 3)
// Replace commit message with the old one if it's empty.
if ([[commitMessageView string] length] > 0)
return;

NSString *message = [[notification userInfo] objectForKey:@"message"];
Expand Down