Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Configure cloneGitRepo task to use default git branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jotok committed Mar 8, 2021
1 parent c0fbea1 commit ed807d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ buildscript {

ext {
es_version = System.getProperty("es.version", "7.10.2")
gitDefaultBranch = 'main'
}
// This isn't applying from repositories.gradle so repeating it here
repositories {
Expand Down Expand Up @@ -78,7 +79,7 @@ apply plugin: 'com.diffplug.spotless'
spotless {
java {
// only apply formatting rules to updated files
ratchetFrom 'origin/main'
ratchetFrom "origin/${gitDefaultBranch}"

licenseHeaderFile(file('license-header'))
googleJavaFormat()
Expand Down Expand Up @@ -309,6 +310,7 @@ task cloneGitRepo(type: GitClone) {
rcaDir = Paths.get(getProject().getBuildDir().toString(), "performance-analyzer-rca").toString()
def destination = file(rcaDir)
uri = "https://github.com/opendistro-for-elasticsearch/performance-analyzer-rca.git"
branch = gitDefaultBranch
destinationPath = destination
bare = false
enabled = !destination.exists() // to clone only once
Expand Down

0 comments on commit ed807d9

Please sign in to comment.