In our setup we run the agents a separate user via ssh ( contoller: jenkins, agent: jenkinsworker).
In a pipeline we checkout some code:
```
node(agent) {
checkout git+ssh://.....
}
```
This results in the workdir and all git files belonging to the user jenkins, not jenkinsworker.
Trying to do a commit (with the need to run a commit-msg hook) fails to run the hook unless I explicitly allow the directory as safe and correct the hook path (it is set to /dev/null if the directory belongs to an other user ).
I would have expected the workdir to be owned by the agent user.