diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 4642490..4738836 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,4 +1,4 @@ -### Before submitting an issue to Gitbucket I have first: +### Before submitting an issue to GitBucket I have first: - [] read the [contribution guidelines](https://github.com/gitbucket/gitbucket/blob/master/.github/CONTRIBUTING.md) - [] searched for similar already existing issue @@ -9,7 +9,7 @@ ## Issue **Impacted version**: xxxx -**Deployment mode**: *explain here how you use gitbucket : standalone app, under webcontainer (which one), with an http frontend (nginx, httpd, ...)* +**Deployment mode**: *explain here how you use GitBucket : standalone app, under webcontainer (which one), with an http frontend (nginx, httpd, ...)* **Problem description**: - *be as explicit has you can* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 981e773..cbc726c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,4 @@ -### Before submitting a pull-request to Gitbucket I have first: +### Before submitting a pull-request to GitBucket I have first: - [] read the [contribution guidelines](https://github.com/gitbucket/gitbucket/blob/master/.github/CONTRIBUTING.md) - [] rebased my branch over master diff --git a/README.md b/README.md index 77935cd..ea6a1a0 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ - [gitbucket-pages-plugin](https://github.com/gitbucket/gitbucket-pages-plugin) - [gitbucket-notifications-plugin](https://github.com/gitbucket/gitbucket-notifications-plugin) -You can find more plugins made by the community at [GitBucket community plugins](http://gitbucket-plugins.github.io/). +You can find more plugins made by the community at [GitBucket community plugins](https://gitbucket-plugins.github.io/). Support -------- diff --git a/doc/jrebel.md b/doc/jrebel.md index 9ea1f68..86a0863 100644 --- a/doc/jrebel.md +++ b/doc/jrebel.md @@ -1,7 +1,7 @@ JRebel integration (optional) ============================= -[JRebel](http://zeroturnaround.com/software/jrebel/) is a JVM plugin that makes developing web apps much faster. +[JRebel](https://zeroturnaround.com/software/jrebel/) is a JVM plugin that makes developing web apps much faster. JRebel is generally able to eliminate the need for the following slow "app restart" in sbt following a code change: ``` @@ -22,12 +22,12 @@ ## 2. Download JRebel -Download the most recent ["nosetup" JRebel zip](http://zeroturnaround.com/software/jrebel/download/prev-releases/). +Download the most recent ["nosetup" JRebel zip](https://zeroturnaround.com/software/jrebel/download/prev-releases/). Next, unzip the downloaded file. ## 3. Activate -Follow the [instructions on the JRebel website](http://zeroturnaround.com/software/jrebel/download/prev-releases/) to activate your downloaded JRebel. +Follow the [instructions on the JRebel website](https://zeroturnaround.com/software/jrebel/download/prev-releases/) to activate your downloaded JRebel. You can use the default settings for all the configurations. diff --git a/src/main/scala/gitbucket/core/controller/ApiController.scala b/src/main/scala/gitbucket/core/controller/ApiController.scala index 9da265e..42cffb3 100644 --- a/src/main/scala/gitbucket/core/controller/ApiController.scala +++ b/src/main/scala/gitbucket/core/controller/ApiController.scala @@ -381,7 +381,7 @@ get("/api/v3/repos/:owner/:repository/issues/:id/comments")(referrersOnly { repository => (for{ issueId <- params("id").toIntOpt - comments = getCommentsForApi(repository.owner, repository.name, issueId.toInt) + comments = getCommentsForApi(repository.owner, repository.name, issueId) } yield { JsonFormat(comments.map{ case (issueComment, user, issue) => ApiComment(issueComment, RepositoryName(repository), issueId, ApiUser(user), issue.isPullRequest) }) }) getOrElse NotFound() diff --git a/src/main/scala/gitbucket/core/controller/ControllerBase.scala b/src/main/scala/gitbucket/core/controller/ControllerBase.scala index d79d86d..60e7893 100644 --- a/src/main/scala/gitbucket/core/controller/ControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/ControllerBase.scala @@ -163,7 +163,7 @@ override def validate(name: String, value: String, params: Map[String, String], messages: Messages): Seq[(String, String)] = valueType.validate(name, trim(value), params, messages) - private def trim(value: String): String = if(value == null) null else value.replaceAll("\r\n", "").trim + private def trim(value: String): String = if(value == null) null else value.replace("\r\n", "").trim } /** diff --git a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala index b116100..8d68272 100644 --- a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala @@ -213,7 +213,7 @@ post("/:owner/:repository/upload", uploadForm)(writableUsersOnly { (form, repository) => val files = form.uploadFiles.split("\n").map { line => - val i = line.indexOf(":") + val i = line.indexOf(':') CommitFile(line.substring(0, i).trim, line.substring(i + 1).trim) } @@ -222,7 +222,7 @@ branch = form.branch, path = form.path, files = files, - message = form.message.getOrElse(s"Add files via upload") + message = form.message.getOrElse("Add files via upload") ) if(form.path.length == 0){ @@ -630,8 +630,8 @@ } }) - case class UploadFiles(branch: String, path: String, fileIds : Map[String,String], message: String) { - lazy val isValid: Boolean = fileIds.size > 0 + case class UploadFiles(branch: String, path: String, fileIds: Map[String,String], message: String) { + lazy val isValid: Boolean = fileIds.nonEmpty } case class CommitFile(id: String, name: String) diff --git a/src/main/scala/gitbucket/core/service/IssuesService.scala b/src/main/scala/gitbucket/core/service/IssuesService.scala index 356907a..ed82f9f 100644 --- a/src/main/scala/gitbucket/core/service/IssuesService.scala +++ b/src/main/scala/gitbucket/core/service/IssuesService.scala @@ -503,14 +503,14 @@ ).flatten ++ labels.map(label => s"label:${label}") ++ List( - milestone.map { _ match { + milestone.map { case Some(x) => s"milestone:${x}" case None => "no:milestone" - }}, - priority.map { _ match { + }, + priority.map { case Some(x) => s"priority:${x}" case None => "no:priority" - }}, + }, (sort, direction) match { case ("created" , "desc") => None case ("created" , "asc" ) => Some("sort:created-asc") diff --git a/src/main/scala/gitbucket/core/service/ProtectedBranchService.scala b/src/main/scala/gitbucket/core/service/ProtectedBranchService.scala index d74280c..5cbb77c 100644 --- a/src/main/scala/gitbucket/core/service/ProtectedBranchService.scala +++ b/src/main/scala/gitbucket/core/service/ProtectedBranchService.scala @@ -18,10 +18,11 @@ .filter(_._1.byPrimaryKey(owner, repository, branch)) .list .groupBy(_._1) + .headOption .map { p => p._1 -> p._2.flatMap(_._2) } .map { case (t1, contexts) => new ProtectedBranchInfo(t1.userName, t1.repositoryName, true, contexts, t1.statusCheckAdmin) - }.headOption + } def getProtectedBranchInfo(owner: String, repository: String, branch: String)(implicit session: Session): ProtectedBranchInfo = getProtectedBranchInfoOpt(owner, repository, branch).getOrElse(ProtectedBranchInfo.disabled(owner, repository)) diff --git a/src/main/scala/gitbucket/core/service/PullRequestService.scala b/src/main/scala/gitbucket/core/service/PullRequestService.scala index 03f2e6e..a368016 100644 --- a/src/main/scala/gitbucket/core/service/PullRequestService.scala +++ b/src/main/scala/gitbucket/core/service/PullRequestService.scala @@ -94,9 +94,9 @@ /** * for repository viewer. - * 1. find pull request from from `branch` to othre branch on same repository + * 1. find pull request from `branch` to other branch on same repository * 1. return if exists pull request to `defaultBranch` - * 2. return if exists pull request to othre branch + * 2. return if exists pull request to other branch * 2. return None */ def getPullRequestFromBranch(userName: String, repositoryName: String, branch: String, defaultBranch: String) @@ -256,7 +256,7 @@ val statuses: List[CommitStatus] = commitStatues ++ (branchProtection.contexts.toSet -- commitStatues.map(_.context).toSet).map(CommitStatus.pending(branchProtection.owner, branchProtection.repository, _)) val hasRequiredStatusProblem = needStatusCheck && branchProtection.contexts.exists(context => statuses.find(_.context == context).map(_.state) != Some(CommitState.SUCCESS)) - val hasProblem = hasRequiredStatusProblem || hasConflict || (!statuses.isEmpty && CommitState.combine(statuses.map(_.state).toSet) != CommitState.SUCCESS) + val hasProblem = hasRequiredStatusProblem || hasConflict || (statuses.nonEmpty && CommitState.combine(statuses.map(_.state).toSet) != CommitState.SUCCESS) val canUpdate = branchIsOutOfDate && !hasConflict val canMerge = hasMergePermission && !hasConflict && !hasRequiredStatusProblem lazy val commitStateSummary:(CommitState, String) = { diff --git a/src/main/scala/gitbucket/core/service/RepositorySearchService.scala b/src/main/scala/gitbucket/core/service/RepositorySearchService.scala index d08c7bc..11be724 100644 --- a/src/main/scala/gitbucket/core/service/RepositorySearchService.scala +++ b/src/main/scala/gitbucket/core/service/RepositorySearchService.scala @@ -67,7 +67,7 @@ files.map { case (path, text) => val (highlightText, lineNumber) = getHighlightText(text, query) FileSearchResult( - path.replaceFirst("\\.md$", ""), + path.stripSuffix(".md"), commits(path).getCommitterIdent.getWhen, highlightText, lineNumber) diff --git a/src/main/scala/gitbucket/core/service/RepositoryService.scala b/src/main/scala/gitbucket/core/service/RepositoryService.scala index e912e3f..cf54dbb 100644 --- a/src/main/scala/gitbucket/core/service/RepositoryService.scala +++ b/src/main/scala/gitbucket/core/service/RepositoryService.scala @@ -135,7 +135,7 @@ repositoryName = newRepositoryName )) :_*) - // TODO Drop transfered owner from collaborators? + // TODO Drop transferred owner from collaborators? Collaborators.insertAll(collaborators.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) // Update activity messages diff --git a/src/main/scala/gitbucket/core/service/WebHookService.scala b/src/main/scala/gitbucket/core/service/WebHookService.scala index e6bb4c1..dc2b9b6 100644 --- a/src/main/scala/gitbucket/core/service/WebHookService.scala +++ b/src/main/scala/gitbucket/core/service/WebHookService.scala @@ -367,9 +367,9 @@ repository: ApiRepository ) extends FieldSerializable with WebHookPayload { val compare = commits.size match { - case 0 => ApiPath(s"/${repository.full_name}") // maybe test hook on un-initalied repository + case 0 => ApiPath(s"/${repository.full_name}") // maybe test hook on un-initialized repository case 1 => ApiPath(s"/${repository.full_name}/commit/${after}") - case _ if before.filterNot(_=='0').isEmpty => ApiPath(s"/${repository.full_name}/compare/${commits.head.id}^...${after}") + case _ if before.forall(_=='0') => ApiPath(s"/${repository.full_name}/compare/${commits.head.id}^...${after}") case _ => ApiPath(s"/${repository.full_name}/compare/${before}...${after}") } val head_commit = commits.lastOption diff --git a/src/main/scala/gitbucket/core/service/WikiService.scala b/src/main/scala/gitbucket/core/service/WikiService.scala index ab034fc..9de4b42 100644 --- a/src/main/scala/gitbucket/core/service/WikiService.scala +++ b/src/main/scala/gitbucket/core/service/WikiService.scala @@ -237,7 +237,7 @@ builder.finish() val newHeadId = JGitUtil.createNewCommit(git, inserter, headId, builder.getDirCache.writeTree(inserter), Constants.HEAD, committer.fullName, committer.mailAddress, - if(message.trim.length == 0) { + if(message.trim.isEmpty) { if(removed){ s"Rename ${currentPageName} to ${newPageName}" } else if(created){ diff --git a/src/main/scala/gitbucket/core/servlet/GitAuthenticationFilter.scala b/src/main/scala/gitbucket/core/servlet/GitAuthenticationFilter.scala index 2947fde..d313661 100644 --- a/src/main/scala/gitbucket/core/servlet/GitAuthenticationFilter.scala +++ b/src/main/scala/gitbucket/core/servlet/GitAuthenticationFilter.scala @@ -74,7 +74,7 @@ val action = request.paths match { case Array(_, repositoryOwner, repositoryName, _*) => Database() withSession { implicit session => - getRepository(repositoryOwner, repositoryName.replaceFirst("\\.wiki\\.git$|\\.git$", "")) match { + getRepository(repositoryOwner, repositoryName.replaceFirst("(\\.wiki)?\\.git$", "")) match { case Some(repository) => { val execute = if (!isUpdating && !repository.repository.isPrivate && settings.allowAnonymousAccess) { // Authentication is not required diff --git a/src/main/scala/gitbucket/core/servlet/GitRepositoryServlet.scala b/src/main/scala/gitbucket/core/servlet/GitRepositoryServlet.scala index a6af98b..fd22630 100644 --- a/src/main/scala/gitbucket/core/servlet/GitRepositoryServlet.scala +++ b/src/main/scala/gitbucket/core/servlet/GitRepositoryServlet.scala @@ -166,7 +166,7 @@ if(repository.endsWith(".wiki")){ defining(request) { implicit r => - receivePack.setPostReceiveHook(new WikiCommitHook(owner, repository.replaceFirst("\\.wiki$", ""), pusher, baseUrl)) + receivePack.setPostReceiveHook(new WikiCommitHook(owner, repository.stripSuffix(".wiki"), pusher, baseUrl)) } } } diff --git a/src/main/scala/gitbucket/core/servlet/PluginAssetsServlet.scala b/src/main/scala/gitbucket/core/servlet/PluginAssetsServlet.scala index 6fe1ed3..e2261a1 100644 --- a/src/main/scala/gitbucket/core/servlet/PluginAssetsServlet.scala +++ b/src/main/scala/gitbucket/core/servlet/PluginAssetsServlet.scala @@ -19,7 +19,7 @@ .find { case (prefix, _, _) => path.startsWith("/plugin-assets" + prefix) } .flatMap { case (prefix, resourcePath, classLoader) => val resourceName = path.substring(("/plugin-assets" + prefix).length) - Option(classLoader.getResourceAsStream(resourcePath.replaceFirst("^/", "") + resourceName)) + Option(classLoader.getResourceAsStream(resourcePath.stripPrefix("/") + resourceName)) } .map { in => try { diff --git a/src/main/scala/gitbucket/core/ssh/SshServerListener.scala b/src/main/scala/gitbucket/core/ssh/SshServerListener.scala index 6d3c123..6ff1d0e 100644 --- a/src/main/scala/gitbucket/core/ssh/SshServerListener.scala +++ b/src/main/scala/gitbucket/core/ssh/SshServerListener.scala @@ -6,7 +6,7 @@ import gitbucket.core.service.SystemSettingsService import gitbucket.core.service.SystemSettingsService.SshAddress -import gitbucket.core.util.{Directory} +import gitbucket.core.util.Directory import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider import org.slf4j.LoggerFactory diff --git a/src/main/scala/gitbucket/core/util/JDBCUtil.scala b/src/main/scala/gitbucket/core/util/JDBCUtil.scala index ffb39ef..8a8574c 100644 --- a/src/main/scala/gitbucket/core/util/JDBCUtil.scala +++ b/src/main/scala/gitbucket/core/util/JDBCUtil.scala @@ -75,7 +75,7 @@ var stringLiteral = false while({ length = in.read(bytes); length != -1 }){ - for(i <- 0 to length - 1){ + for(i <- 0 until length){ val c = bytes(i) if(c == '\''){ stringLiteral = !stringLiteral @@ -146,13 +146,11 @@ } } - val columnValues = values.map { value => - value match { - case x: String => "'" + x.replace("'", "''") + "'" - case x: Timestamp => "'" + dateFormat.format(x) + "'" - case null => "NULL" - case x => x - } + val columnValues = values.map { + case x: String => "'" + x.replace("'", "''") + "'" + case x: Timestamp => "'" + dateFormat.format(x) + "'" + case null => "NULL" + case x => x } sb.append(columnValues.mkString(", ")) sb.append(");\n") diff --git a/src/main/scala/gitbucket/core/util/JGitUtil.scala b/src/main/scala/gitbucket/core/util/JGitUtil.scala index a30c0ba..6e68bf5 100644 --- a/src/main/scala/gitbucket/core/util/JGitUtil.scala +++ b/src/main/scala/gitbucket/core/util/JGitUtil.scala @@ -93,7 +93,7 @@ val summary = getSummaryMessage(fullMessage, shortMessage) - val description = defining(fullMessage.trim.indexOf("\n")){ i => + val description = defining(fullMessage.trim.indexOf('\n')){ i => if(i >= 0){ Some(fullMessage.trim.substring(i).trim) } else None @@ -293,7 +293,7 @@ @tailrec def findLastCommits(result:List[(ObjectId, FileMode, String, String, Option[String], RevCommit)], restList:List[((ObjectId, FileMode, String, String, Option[String]), Map[RevCommit, RevCommit])], - revIterator:java.util.Iterator[RevCommit]): List[(ObjectId, FileMode, String, String, Option[String], RevCommit)] ={ + revIterator:java.util.Iterator[RevCommit]): List[(ObjectId, FileMode, String, String, Option[String], RevCommit)] = { if(restList.isEmpty){ result } else if(!revIterator.hasNext){ // maybe, revCommit has only 1 log. other case, restList be empty @@ -364,9 +364,9 @@ (file1.isDirectory, file2.isDirectory) match { case (true , false) => true case (false, true ) => false - case _ => file1.name.compareTo(file2.name) < 0 + case _ => file1.name.compareTo(file2.name) < 0 } - }.toList + } } } @@ -374,7 +374,7 @@ * Returns the first line of the commit message. */ private def getSummaryMessage(fullMessage: String, shortMessage: String): String = { - defining(fullMessage.trim.indexOf("\n")){ i => + defining(fullMessage.trim.indexOf('\n')){ i => defining(if(i >= 0) fullMessage.trim.substring(0, i).trim else fullMessage){ firstLine => if(firstLine.length > shortMessage.length) shortMessage else firstLine } diff --git a/src/main/scala/gitbucket/core/view/helpers.scala b/src/main/scala/gitbucket/core/view/helpers.scala index b308c5f..6f38ccb 100644 --- a/src/main/scala/gitbucket/core/view/helpers.scala +++ b/src/main/scala/gitbucket/core/view/helpers.scala @@ -128,7 +128,7 @@ repository: RepositoryService.RepositoryInfo, enableWikiLink: Boolean, enableRefsLink: Boolean, enableAnchor: Boolean)(implicit context: Context): Html = { - val fileName = filePath.reverse.head.toLowerCase + val fileName = filePath.last.toLowerCase val extension = FileUtil.getExtension(fileName) val renderer = PluginRegistry().getRenderer(extension) renderer.render(RenderRequest(filePath, fileContent, branch, repository, enableWikiLink, enableRefsLink, enableAnchor, context)) diff --git a/src/main/twirl/gitbucket/core/helper/copy.scala.html b/src/main/twirl/gitbucket/core/helper/copy.scala.html index 10b3a80..fa0a05d 100644 --- a/src/main/twirl/gitbucket/core/helper/copy.scala.html +++ b/src/main/twirl/gitbucket/core/helper/copy.scala.html @@ -18,7 +18,7 @@ if (document.queryCommandSupported('copy')) { var title = $('#@copyButtonId').attr('title'); $('#@copyButtonId').tooltip({ - @* if default container is used then 2 lines tooltip text is displayd because tooptip width is narrow. *@ + @* if default container is used then 2 lines tooltip text is displayed because tooptip width is narrow. *@ container: 'body' }); $('#@copyButtonId').on('click', function() { diff --git a/src/main/twirl/gitbucket/core/helper/feed.scala.xml b/src/main/twirl/gitbucket/core/helper/feed.scala.xml index 4d93f0d..0ce79ef 100644 --- a/src/main/twirl/gitbucket/core/helper/feed.scala.xml +++ b/src/main/twirl/gitbucket/core/helper/feed.scala.xml @@ -2,10 +2,10 @@ @import gitbucket.core.view.helpers tag:@context.host,2013:gitbucket - Gitbucket's activities + GitBucket's activities - Gitbucket + GitBucket @context.baseUrl @helpers.datetimeRFC3339(if(activities.isEmpty) new java.util.Date else activities.map(_.activityDate).max) diff --git a/src/main/twirl/gitbucket/core/repo/blob.scala.html b/src/main/twirl/gitbucket/core/repo/blob.scala.html index 74f67d6..92d3612 100644 --- a/src/main/twirl/gitbucket/core/repo/blob.scala.html +++ b/src/main/twirl/gitbucket/core/repo/blob.scala.html @@ -71,7 +71,7 @@ @if(content.viewType == "text"){ - @defining(helpers.isRenderable(pathList.reverse.head)){ isRenderable => + @defining(helpers.isRenderable(pathList.last)){ isRenderable => @if(!isBlame && isRenderable) {
@helpers.renderMarkup(pathList, content.content.get, branch, repository, false, false, true) diff --git a/src/main/twirl/gitbucket/core/repo/files.scala.html b/src/main/twirl/gitbucket/core/repo/files.scala.html index bb9f254..9a1c95b 100644 --- a/src/main/twirl/gitbucket/core/repo/files.scala.html +++ b/src/main/twirl/gitbucket/core/repo/files.scala.html @@ -175,7 +175,7 @@ @readme.map { case(filePath, content) =>
-
@filePath.reverse.head
+
@filePath.last
@helpers.renderMarkup(filePath, content, branch, repository, false, false, true)
} diff --git a/src/main/twirl/gitbucket/core/repo/tags.scala.html b/src/main/twirl/gitbucket/core/repo/tags.scala.html index a8b9276..c3503aa 100644 --- a/src/main/twirl/gitbucket/core/repo/tags.scala.html +++ b/src/main/twirl/gitbucket/core/repo/tags.scala.html @@ -12,7 +12,7 @@ - @repository.tags.reverse.map { tag => + @repository.tags.reverseMap { tag => @tag.name @gitbucket.core.helper.html.datetimeago(tag.time, false) diff --git a/src/main/webapp/assets/common/js/gitbucket.js b/src/main/webapp/assets/common/js/gitbucket.js index d6b007b..8be1dc5 100644 --- a/src/main/webapp/assets/common/js/gitbucket.js +++ b/src/main/webapp/assets/common/js/gitbucket.js @@ -443,7 +443,7 @@ * @param word {String} search word * @param strings {Array[String]} search targets * @param limit {Integer} result limit - * @return {Array[{score:"float matching score", string:"string target string", matchingPositions:"Array[Interger] matchng positions"}]} + * @return {Array[{score:"float matching score", string:"string target string", matchingPositions:"Array[Integer] matching positions"}]} */ function string_score_sort(word, strings, limit){ var ret = [], i=0, l = (word==="")?Math.min(strings.length, limit):strings.length; @@ -466,7 +466,7 @@ } /** * highlight by result. - * @param score {string:"string target string", matchingPositions:"Array[Interger] matchng positions"} + * @param score {string:"string target string", matchingPositions:"Array[Integer] matching positions"} * @param highlight tag ex: '' * @return array of highlighted html elements. */ diff --git a/src/test/scala/gitbucket/core/service/MergeServiceSpec.scala b/src/test/scala/gitbucket/core/service/MergeServiceSpec.scala index f9eecd4..be90da4 100644 --- a/src/test/scala/gitbucket/core/service/MergeServiceSpec.scala +++ b/src/test/scala/gitbucket/core/service/MergeServiceSpec.scala @@ -18,7 +18,7 @@ def initRepository(owner:String, name:String): File = { val dir = createTestRepository(getRepositoryDir(owner, name)) using(Git.open(dir)){ git => - createFile(git, s"refs/heads/master", "test.txt", "hoge" ) + createFile(git, "refs/heads/master", "test.txt", "hoge" ) git.branchCreate().setStartPoint(s"refs/heads/master").setName(s"refs/pull/${issueId}/head").call() } dir diff --git a/src/test/scala/gitbucket/core/service/PullRequestServiceSpec.scala b/src/test/scala/gitbucket/core/service/PullRequestServiceSpec.scala index a7b8050..f0437c9 100644 --- a/src/test/scala/gitbucket/core/service/PullRequestServiceSpec.scala +++ b/src/test/scala/gitbucket/core/service/PullRequestServiceSpec.scala @@ -11,15 +11,15 @@ describe("PullRequestService.getPullRequestFromBranch") { it("""should |return pull request if exists pull request from `branch` to `defaultBranch` and not closed. - |return pull request if exists pull request from `branch` to othre branch and not closed. + |return pull request if exists pull request from `branch` to other branch and not closed. |return None if all pull request is closed""".stripMargin.trim) { withTestDB { implicit se => generateNewUserWithDBRepository("user1", "repo1") generateNewUserWithDBRepository("user1", "repo2") generateNewUserWithDBRepository("user2", "repo1") generateNewPullRequest("user1/repo1/master", "user1/repo1/head2") // not target branch generateNewPullRequest("user1/repo1/head1", "user1/repo1/master") // not target branch ( swap from, to ) - generateNewPullRequest("user1/repo1/master", "user2/repo1/head1") // othre user - generateNewPullRequest("user1/repo1/master", "user1/repo2/head1") // othre repository + generateNewPullRequest("user1/repo1/master", "user2/repo1/head1") // other user + generateNewPullRequest("user1/repo1/master", "user1/repo2/head1") // other repository val r1 = swap(generateNewPullRequest("user1/repo1/master2", "user1/repo1/head1")) val r2 = swap(generateNewPullRequest("user1/repo1/master", "user1/repo1/head1")) val r3 = swap(generateNewPullRequest("user1/repo1/master4", "user1/repo1/head1")) @@ -31,4 +31,4 @@ assert(getPullRequestFromBranch("user1", "repo1", "head1", "master") == None) } } } -} \ No newline at end of file +} diff --git a/src/test/scala/gitbucket/core/view/HelpersSpec.scala b/src/test/scala/gitbucket/core/view/HelpersSpec.scala index 3b41e3e..9b60b63 100644 --- a/src/test/scala/gitbucket/core/view/HelpersSpec.scala +++ b/src/test/scala/gitbucket/core/view/HelpersSpec.scala @@ -32,7 +32,7 @@ assert(after == """Example Project. http://example.com""") } - it("should convert a mulitple links within text") { + it("should convert a multiple links within text") { val before = "Example Project. http://example.com. (See also https://github.com/)" val after = detectAndRenderLinks(before, repository) assert(after == """Example Project. http://example.com. (See also https://github.com/)""")