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.
This commit is contained in:
Joe Fiorini
2009-05-24 16:43:40 -04:00
committed by Pieter de Bie
parent a93740a3a7
commit 40ba75045d
+3
View File
@@ -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)