Allow start-commit hook to prevent the Commit dialog from showing.
Summary:
The start-commit hook does not prevent the Commit dialog from showing when the hook returns a non-zero exit code.
What steps will reproduce the problem?
-
Create a start-commit hook batch file that returns an error code.
-
start-commit.bat:
EXIT 1
-
-
Add this to the hooks in TortoiseGit
- Hook Type:
Start Commit Hook
- Command Line to Execute:
C:\path\to\start-commit.bat
- Wait for script to finish:
True
- Other items: doesn't matter
- Hook Type:
-
Attempt to commit a change to a repo.
-
See the error dialog as expected and press
OK
. -
At this point, the TortoiseGit Commit dialog appears.
What is the expected output? What do you see instead?
On step 5, the commit dialog is displayed. I believe that it should not be displayed if the start-commit scripts returns a non-zero exit code.
What version of TortoiseGit and Git are you using? On what operating system?
- git: 2.5.0.windows.1
- TortoiseGit: 1.8.15.0
- OS: Windows 7 Pro SP1