mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Fix message
This commit is contained in:
@@ -32,7 +32,7 @@ class MergeServiceSpec extends FunSpec {
|
||||
val repo1Dir = initRepository("user1","repo1")
|
||||
assert(service.checkConflictCache("user1", "repo1", branch, issueId) == None)
|
||||
val conflicted = service.checkConflict("user1", "repo1", branch, issueId)
|
||||
assert(service.checkConflictCache("user1", "repo1", branch, issueId) == Some(false))
|
||||
assert(service.checkConflictCache("user1", "repo1", branch, issueId) == Some(None))
|
||||
assert(conflicted.isEmpty)
|
||||
}
|
||||
it("checkConflict true if not conflicted, and create cache") {
|
||||
@@ -43,14 +43,17 @@ class MergeServiceSpec extends FunSpec {
|
||||
assert(service.checkConflictCache("user1", "repo2", branch, issueId) == None)
|
||||
val conflicted = service.checkConflict("user1", "repo2", branch, issueId)
|
||||
assert(conflicted.isDefined)
|
||||
assert(service.checkConflictCache("user1", "repo2", branch, issueId) == Some(true))
|
||||
assert(service.checkConflictCache("user1", "repo2", branch, issueId) match {
|
||||
case Some(Some(_: String)) => true
|
||||
case _ => false
|
||||
})
|
||||
}
|
||||
}
|
||||
describe("checkConflictCache") {
|
||||
it("merged cache invalid if origin branch moved") {
|
||||
val repo3Dir = initRepository("user1","repo3")
|
||||
assert(service.checkConflict("user1", "repo3", branch, issueId) == false)
|
||||
assert(service.checkConflictCache("user1", "repo3", branch, issueId) == Some(false))
|
||||
assert(service.checkConflict("user1", "repo3", branch, issueId).isEmpty)
|
||||
assert(service.checkConflictCache("user1", "repo3", branch, issueId) == Some(None))
|
||||
using(Git.open(repo3Dir)){ git =>
|
||||
createFile(git, s"refs/heads/${branch}", "test.txt", "hoge2" )
|
||||
}
|
||||
@@ -58,8 +61,8 @@ class MergeServiceSpec extends FunSpec {
|
||||
}
|
||||
it("merged cache invalid if request branch moved") {
|
||||
val repo4Dir = initRepository("user1","repo4")
|
||||
assert(service.checkConflict("user1", "repo4", branch, issueId) == false)
|
||||
assert(service.checkConflictCache("user1", "repo4", branch, issueId) == Some(false))
|
||||
assert(service.checkConflict("user1", "repo4", branch, issueId).isEmpty)
|
||||
assert(service.checkConflictCache("user1", "repo4", branch, issueId) == Some(None))
|
||||
using(Git.open(repo4Dir)){ git =>
|
||||
createFile(git, s"refs/pull/${issueId}/head", "test.txt", "hoge4" )
|
||||
}
|
||||
@@ -67,8 +70,8 @@ class MergeServiceSpec extends FunSpec {
|
||||
}
|
||||
it("should merged cache invalid if origin branch moved") {
|
||||
val repo5Dir = initRepository("user1","repo5")
|
||||
assert(service.checkConflict("user1", "repo5", branch, issueId) == false)
|
||||
assert(service.checkConflictCache("user1", "repo5", branch, issueId) == Some(false))
|
||||
assert(service.checkConflict("user1", "repo5", branch, issueId).isEmpty)
|
||||
assert(service.checkConflictCache("user1", "repo5", branch, issueId) == Some(None))
|
||||
using(Git.open(repo5Dir)){ git =>
|
||||
createFile(git, s"refs/heads/${branch}", "test.txt", "hoge2" )
|
||||
}
|
||||
@@ -79,8 +82,11 @@ class MergeServiceSpec extends FunSpec {
|
||||
using(Git.open(repo6Dir)){ git =>
|
||||
createConfrict(git)
|
||||
}
|
||||
assert(service.checkConflict("user1", "repo6", branch, issueId) == true)
|
||||
assert(service.checkConflictCache("user1", "repo6", branch, issueId) == Some(true))
|
||||
assert(service.checkConflict("user1", "repo6", branch, issueId).isDefined)
|
||||
assert(service.checkConflictCache("user1", "repo6", branch, issueId) match {
|
||||
case Some(Some(_: String)) => true
|
||||
case _ => false
|
||||
})
|
||||
using(Git.open(repo6Dir)){ git =>
|
||||
createFile(git, s"refs/pull/${issueId}/head", "test.txt", "hoge4" )
|
||||
}
|
||||
@@ -91,8 +97,11 @@ class MergeServiceSpec extends FunSpec {
|
||||
using(Git.open(repo7Dir)){ git =>
|
||||
createConfrict(git)
|
||||
}
|
||||
assert(service.checkConflict("user1", "repo7", branch, issueId) == true)
|
||||
assert(service.checkConflictCache("user1", "repo7", branch, issueId) == Some(true))
|
||||
assert(service.checkConflict("user1", "repo7", branch, issueId).isDefined)
|
||||
assert(service.checkConflictCache("user1", "repo7", branch, issueId) match {
|
||||
case Some(Some(_)) => true
|
||||
case _ => false
|
||||
})
|
||||
using(Git.open(repo7Dir)){ git =>
|
||||
createFile(git, s"refs/heads/${branch}", "test.txt", "hoge4" )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user