|Issue 4841||GIT_DIR not filled in for ref-update hooks with the new hooks-plugin.|
|Starred by 2 users||Reported by christia...@esrlabs.com, Oct 31||Back to list|
Affected Version: 2.13.2 What steps will reproduce the problem? 0. I built gerrit with its plugins from source using the 2.13.2 tag. 1. Install hooks core plugin, add a ref-update hook e.g. shell script that just prints the env and exits with 1. 2. Push a commit. 3. The env (printed in the git-client) does not contain an environment variable with GIT_DIR. What is the expected output? GIT_DIR set to the project that is pushed to What do you see instead? Some debug output in the plugin showed me that in HookTask projectName is null although the hookArgs contain --project example. Please provide any additional information below.
I added the lines: log.error("projectName: '" + projectName); log.error("hookargs: '" + args); before the if (projectName != null) test in HookTask.java. this gives the described output.
Patch for CommitReceived, that adds the project name to the run call of the hook. The project name is calculated by using toString on a ProjectNameKey-object. Not sure if this is the way to go.
I opened up review https://gerrit-review.googlesource.com/#/c/90551/ for this.
|► Sign in to add a comment|