mirror of
https://github.com/enso-org/enso.git
synced 2024-11-23 08:08:34 +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 = {
|
private def repository(root: Path): Repository = {
|
||||||
val builder = new FileRepositoryBuilder()
|
val builder = new FileRepositoryBuilder()
|
||||||
builder
|
val repo = builder
|
||||||
.setWorkTree(root.toFile)
|
.setWorkTree(root.toFile)
|
||||||
.setGitDir(root.resolve(gitDir).toFile)
|
.setGitDir(root.resolve(gitDir).toFile)
|
||||||
.setMustExist(true)
|
.setMustExist(true)
|
||||||
.build()
|
.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] = {
|
override def init(root: Path): BlockingIO[VcsFailure, Unit] = {
|
||||||
@ -71,6 +77,7 @@ private class Git(ensoDataDirectory: Option[Path]) extends VcsApi[BlockingIO] {
|
|||||||
.setDirectory(root.toFile)
|
.setDirectory(root.toFile)
|
||||||
.setBare(false)
|
.setBare(false)
|
||||||
.call()
|
.call()
|
||||||
|
disableAutoCRLF(jgit.getRepository)
|
||||||
|
|
||||||
ensoDataDirectory.foreach { _ =>
|
ensoDataDirectory.foreach { _ =>
|
||||||
// When `gitDir` is set, JGit **always** creates a .git file (not a directory!) that points at the real
|
// 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