Bug: Wrong cmd parameter for pre-commit-hook when creating a branch

14 views
Skip to first unread message

Marcel Meschenmoser

unread,
Feb 1, 2018, 4:15:50 AM2/1/18
to TortoiseSVN
Hello,

We have setup a pre-commit-hook script on the client side, which uncrustifies every file before commiting them. It works perfectly, but when we create a branch we get the following error : A parameter cannot be found that matches parameter name '2'.

When we commit a file we get the following arguments for the script (as described in the help) ->  4.30.8. Client Side Hook Scripts
PATH DEPTH MESSAGEFILE CWD

But when we create a branch we get the following arguments for the script:
PATH
and in parameter name '2': MESSAGEFILE
the other parameter are empty


the powershell script:
param (
[Parameter(Mandatory=$true)]
[string]$tortoiseFile, #path to temp file with file list
[Parameter(Mandatory=$false)]
[string]$arg1, # dept
[Parameter(Mandatory=$false)]
[string]$arg2, # messagefile
[Parameter(Mandatory=$false)]
[string]$arg3, # cwd = repo
[Parameter(Mandatory=$false)]
[string]$arg4, # not used
[Parameter(Mandatory=$false)]
[string]$2     # in case of a branch, here comes the messagefile
)

without the parameter $2, the script fails

I would expect, that we get the same parameters when we commit some files as when we create a branch

As a workaround add the last two lines in the script
But I would likely have it fixed

Of course we used the last version (1.9.7 Build 27907)
Used Versions.jpg
Error_WhenCreatingBranch.jpg

Stefan

unread,
Feb 1, 2018, 12:48:16 PM2/1/18
to TortoiseSVN
The hook script is called the very same way for commits and copies (copies = branches/tags).
You can check the source code yourself if you like.

Try printing out the full command line you get in the script. Maybe you can use that info to further pinpoint the problem.
Reply all
Reply to author
Forward
0 new messages