Skip to content

Commit cf4056c

Browse files
authored
use checkoutCredentialsId if available (#821)
1 parent 2835818 commit cf4056c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketGitSCMBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
package com.cloudbees.jenkins.plugins.bitbucket;
2525

26+
import com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.DescriptorImpl;
2627
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator;
2728
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketHref;
2829
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRepository;
@@ -160,7 +161,7 @@ public BitbucketGitSCMBuilder withCredentials(String credentialsId, BitbucketRep
160161
StandardCredentials credentials = BitbucketCredentials.lookupCredentials(
161162
scmSource.getServerUrl(),
162163
scmSource.getOwner(),
163-
credentialsId,
164+
DescriptorImpl.SAME.equals(scmSource.getCheckoutCredentialsId()) ? credentialsId : scmSource.getCheckoutCredentialsId(),
164165
StandardCredentials.class
165166
);
166167

0 commit comments

Comments
 (0)