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

prevent failure on sbt init when JGit finds a .git with no commit #141

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Jul 6, 2020

Ref scalacenter/scalafix#1196
Regression detected between 0.9.17 & 0.9.18, introduced by #126

2ca68e4 exposed the failure to lookup commits during sbt initialization, while it would only happen on scalafix invocation earlier.

While looking at that, I initially thought 2ca68e4 changed the behavior by eagerly fetching the last commits into a setting, but that lookup is memoized in a lazy val anyway, so a sbt reload is required before or after 2ca68e4 to get an up-to-date list of commits.

Comment on lines 20 to 26
test("directory with no commits") {
val fs = new Fs()
new Git(fs.workingDirectory) // git init
val jgit = new JGitCompletion(fs.workingDirectory)
assert(jgit.last20Commits == Nil)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the one reproducing scalacenter/scalafix#1196 (comment) (the other tests pass on master, while this one fails)

2ca68e4 exposed failure to lookup commits during sbt initialization,
while it would only happen on `scalafix` invocation earlier.
@bjaglin bjaglin merged commit 9ef7380 into scalacenter:master Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants