package com.softwaremill.codebrag.service.github.jgit

import java.nio.file.{Paths, Path}
import com.softwaremill.codebrag.service.config.CodebragConfiguration
import org.eclipse.jgit.util.StringUtils._

class InternalGitDirTree {

  def containsRepo(owner: String, repoName: String): Boolean = {
    getPath(owner, repoName).toFile.exists()
  }

  def getPath(owner: String, repoName: String): Path = Paths.get(s"${InternalGitDirTree.Root}/$owner/$repoName")
}

object InternalGitDirTree {

  val Root = (
    if (!isEmptyOrNull(CodebragConfiguration.localGitPath))
      CodebragConfiguration.localGitPath
    else ".") + "/repos"
}
package com.softwaremill.codebrag.service.github.jgit

import java.nio.file.{Paths, Path}
import com.softwaremill.codebrag.service.config.CodebragConfiguration

class InternalGitDirTree {

  def containsRepo(owner: String, repoName: String): Boolean = {
    getPath(owner, repoName).toFile.exists()
  }

  def getPath(owner: String, repoName: String): Path = Paths.get(s"${InternalGitDirTree.Root}/$owner/$repoName")
}

object InternalGitDirTree {

  val Root = (
    if (!CodebragConfiguration.localGitPath.equals(""))
      CodebragConfiguration.localGitPath
    else ".") + "/repos"
}
--- 
+++ 
@@ -2,6 +2,7 @@
 
 import java.nio.file.{Paths, Path}
 import com.softwaremill.codebrag.service.config.CodebragConfiguration
+import org.eclipse.jgit.util.StringUtils._
 
 class InternalGitDirTree {
 
@@ -15,7 +16,7 @@
 object InternalGitDirTree {
 
   val Root = (
-    if (!CodebragConfiguration.localGitPath.equals(""))
+    if (!isEmptyOrNull(CodebragConfiguration.localGitPath))
       CodebragConfiguration.localGitPath
     else ".") + "/repos"
 }
Fix loading of path for local repos from configuration
- It was crashing on non-existing file
