File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -177,8 +177,13 @@ - (void)commitWithMessage:(NSString *)commitMessage
177
177
int ret = 1 ;
178
178
179
179
[self postCommitUpdate: @" Running hooks" ];
180
- if (![repository executeHook: @" pre-commit" output: nil ])
181
- return [self postCommitFailure: @" Pre-commit hook failed" ];
180
+ NSString *preCommitHookOutput = nil ;
181
+ if (![repository executeHook: @" pre-commit" output: &preCommitHookOutput]) {
182
+ NSString *preCommitFailureMessage = [NSString stringWithFormat: @" Pre-commit hook failed%@%@ " ,
183
+ [preCommitHookOutput length ] > 0 ? @" :\n " : @" " ,
184
+ preCommitHookOutput];
185
+ return [self postCommitFailure: preCommitFailureMessage];
186
+ }
182
187
183
188
if (![repository executeHook: @" commit-msg" withArgs: [NSArray arrayWithObject: commitMessageFile] output: nil ])
184
189
return [self postCommitFailure: @" Commit-msg hook failed" ];
You can’t perform that action at this time.
0 commit comments