mohamicorp / stash-jenkins-postreceive-webhook

Webhook used to notify Jenkins when commits are made to Stash
Other
138 stars 98 forks source link

Bug in using SSH #16

Closed mikesir87 closed 11 years ago

mikesir87 commented 11 years ago

On the current develop branch, the repo URL is generated and can be overridden with a new base URL. The URL is generated using the NavBuilder. Apparently, the URL provided does not work for SSH, even if swapping out the base URL.

Example: HTTP Clone URL: http://test.jenkins/stash/scm/test/helloworld.git SSH Clone URL: ssh://git@test.jenkins:7999/test/helloworld.git NavBuilder Provides: http://test.jenkins/stash/scm/test/helloworld.git

Note that there's the extra /scm/ in the HTTP/NavBuilder URL. The fix is simply to replace the /scm/ if a Overridden Base URL uses SSH. But, want a second pair of eyes to confirm.

kuhnroyal commented 11 years ago

I am using HTTP so I didn't see that. I would go with stashBaseUrl.StartsWith("ssh") instead of the index.

mikesir87 commented 11 years ago

Duh... makes sense. I'll go ahead and do that.