Good fix for JENKINS-2499: Introduce possibility to hook only specified branches on the commit

This was done in the same way Git-Hub plugin does.