Skip to content

Commit

Permalink
Handle Grgit/JGit initing 'main'
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielThomas committed May 9, 2024
1 parent 5723a42 commit f3d692e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ abstract class GitVersioningIntegrationTestKitSpec extends IntegrationTestKitSpe
originGit.add(patterns: ['build.gradle', 'settings.gradle', '.gitignore'] as Set)
originGit.commit(message: 'Initial checkout')

if (originGit.branch.current().name == 'main') {
originGit.checkout(branch: 'master', createBranch: true)
originGit.branch.remove(names: ['main'])
}

git = Grgit.clone(dir: projectDir, uri: origin.absolutePath) as Grgit

new File(projectDir, '.gitignore') << '''.gradle-test-kit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class ReleasePluginIntegrationSpec extends GitVersioningIntegrationTestKitSpec {
version == dev('0.1.0-dev.2+')
}


def 'build on non standard branch appends name to dev version string'() {
git.checkout(branch: 'testexample', createBranch: true)

Expand Down

0 comments on commit f3d692e

Please sign in to comment.