mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 17:34:10 +03:00
Workaround vcs/restore issues on Windows (#4042)
Potential workaround to line endings problems after `vcs/restore` operation is executed. # Important Notes Not really able to reproduce the problem myself so this PR has a lot of _leap of faith_ in it.
This commit is contained in:
parent
fc62b3b60c
commit
a3de151ff4
@ -38,11 +38,17 @@ private class Git(ensoDataDirectory: Option[Path]) extends VcsApi[BlockingIO] {
|
||||
|
||||
private def repository(root: Path): Repository = {
|
||||
val builder = new FileRepositoryBuilder()
|
||||
builder
|
||||
val repo = builder
|
||||
.setWorkTree(root.toFile)
|
||||
.setGitDir(root.resolve(gitDir).toFile)
|
||||
.setMustExist(true)
|
||||
.build()
|
||||
disableAutoCRLF(repo)
|
||||
repo
|
||||
}
|
||||
|
||||
private def disableAutoCRLF(repo: Repository): Unit = {
|
||||
repo.getConfig.setString("core", null, "autocrlf", "false")
|
||||
}
|
||||
|
||||
override def init(root: Path): BlockingIO[VcsFailure, Unit] = {
|
||||
@ -71,6 +77,7 @@ private class Git(ensoDataDirectory: Option[Path]) extends VcsApi[BlockingIO] {
|
||||
.setDirectory(root.toFile)
|
||||
.setBare(false)
|
||||
.call()
|
||||
disableAutoCRLF(jgit.getRepository)
|
||||
|
||||
ensoDataDirectory.foreach { _ =>
|
||||
// When `gitDir` is set, JGit **always** creates a .git file (not a directory!) that points at the real
|
||||
|
Loading…
Reference in New Issue
Block a user