Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: fhopf/gitta
base: 29cdcc980b
...
head fork: fhopf/gitta
compare: 4d6c8ef07f
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
View
2  src/main/scala/org/synyx/git/RepositoryService.scala
@@ -21,7 +21,7 @@ object RepositoryService {
def log(repo: Repository) = {
val builder = new RepositoryBuilder();
- val repository = builder.setGitDir(repo.folder)
+ val repository = builder.addCeilingDirectory(repo.folder)
.readEnvironment() // scan environment GIT_* variables
.findGitDir() // scan up the file system tree
.build();
View
23 src/test/scala/org/synyx/git/RepositoryServiceTest.scala
@@ -3,10 +3,11 @@ package org.synyx.git
import org.scalatest.FunSuite
import java.io.File
import org.scalatest.junit.JUnitRunner
+import org.scalatest.matchers.ShouldMatchers
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
-class RepositoryServiceTest extends FunSuite {
+class RepositoryServiceTest extends FunSuite with ShouldMatchers {
val service = RepositoryService
@@ -15,10 +16,26 @@ class RepositoryServiceTest extends FunSuite {
service.updateRepo(repo)
- assert(repo.folder.exists)
+ repo.folder.exists should be(true)
val gitDir = new File(repo.folder, ".git")
- assert(gitDir.exists)
+ gitDir.exists should be(true)
}
+ test("log returns a list of commits") {
+ val repo = new Repository(new File("/tmp/" + System.currentTimeMillis()), "git://github.com/fhopf/maven-deployment-from-webapp.git");
+
+ service.updateRepo(repo)
+
+ import scala.collection.JavaConversions._
+
+ val commits = service.log(repo)
+
+ commits.isEmpty should be(false)
+
+ for (commit <- commits) {
+ println(commit)
+ }
+
+ }
}

No commit comments for this range

Something went wrong with that request. Please try again.