From 40ba75045d2fdaee2109f0b47b642d07075ab4dd Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Sun, 24 May 2009 16:43:40 -0400 Subject: [PATCH] Trigger commit-msg hook when committing A failure of the commit-msg hook (similar to the pre-commit hook) will cause the commit to abort. Commit-msg requires an argument containing the filename holding the commit, in this case .git/COMMIT_EDITMSG. --- PBGitCommitController.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 15d889d..227820a 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -320,6 +320,9 @@ if (![repository executeHook:@"pre-commit" output:nil]) return [self commitFailedBecause:@"Pre-commit hook failed"]; + if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) + return [self commitFailedBecause:@"Commit-msg hook failed"]; + [repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-m", commitSubject, @"HEAD", commit, nil] retValue: &ret]; if (ret)