Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes tests dependency on personal git config file #369

Merged
merged 1 commit into from Feb 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -21,6 +21,9 @@ class GitProjectBuilder {
this.rawRepository = Grgit.init(dir: repositoryDir)
this.scmProperties = ScmPropertiesBuilder.scmProperties(repositoryDir).build()
this.identity = ScmIdentity.defaultIdentityWithoutAgents()

// let's make sure, not to use system wide user settings in tests
this.rawRepository.repository.jgit.repository.config.baseConfig.clear()
}

private GitProjectBuilder(File project, File cloneFrom) {
Expand All @@ -29,6 +32,9 @@ class GitProjectBuilder {
this.rawRepository = Grgit.clone(dir: repositoryDir, uri: "file://${cloneFrom.canonicalPath}")
this.scmProperties = ScmPropertiesBuilder.scmProperties(repositoryDir).build()
this.identity = ScmIdentity.defaultIdentityWithoutAgents()

// let's make sure, not to use system wide user settings in tests
this.rawRepository.repository.jgit.repository.config.baseConfig.clear()
}

static GitProjectBuilder gitProject(File project) {
Expand Down