Skip to content

Commit 871ba57

Browse files
Thomas Michaelschnatterer
authored andcommitted
fetch command needs credentials
1 parent 5c22973 commit 871ba57

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/groovy/com/cloudogu/gitops/features/Content.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ class Content extends Feature {
252252
def git = cloneCommand.call()
253253

254254
if (ContentRepoType.MIRROR == repoConfig.type) {
255-
git.fetch().setRefSpecs("+refs/*:refs/*").call() // Fetch all branches and tags
255+
def fetch = git.fetch()
256+
// fetch also needs CredentialProvider, jgit behaviour.
257+
fetch.setCredentialsProvider(new UsernamePasswordCredentialsProvider(repoConfig.username, repoConfig.password))
258+
fetch.setRefSpecs("+refs/*:refs/*").call() // Fetch all branches and tags
256259
}
257260

258261
if (repoConfig.ref) {

0 commit comments

Comments
 (0)