When using JGit do a push to remote which is on the same server.
1) if the remote was configured with file://
or /path/to/git/remote
, the pre-receive hook won't be executed.
2) if the remote was configured with ssh://
, the pre-receive hook will be executed.
If doing the same push using the Git command line, pre-receive hook will always be executed.
I don't understand why this is happening.
JGit doesn't support all hooks; when you push via ssh:
the remote server's git implementation is performing the git hook support. When you use JGit to push to a local repository it's just updating the local contents of the repository. (I'm not even sure if pushing to a local repository with a native git
client will execute a pre-receive
since it's not running git upload-pack
and therefore not doing a receive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With