mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
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:
committed by
Pieter de Bie
parent
a93740a3a7
commit
40ba75045d
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user