Skip to content

Commit

Permalink
Support Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Tyley authored and rtyley committed Jan 2, 2023
1 parent b68f0d9 commit bd36517
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import ReleaseTransformations._
import Dependencies._

lazy val baseSettings = Seq(
scalaVersion := "2.13.10",
crossScalaVersions := Seq(scalaVersion.value),
crossScalaVersions := Seq(scalaVersion.value, "3.2.1"),
organization := "com.madgag.scala-git",
scmInfo := Some(ScmInfo(
url("https://github.com/rtyley/scala-git"),
"scm:git:git@github.com:rtyley/scala-git.git"
)),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
scalacOptions ++= Seq("-deprecation", "-unchecked")
)

Expand Down
4 changes: 2 additions & 2 deletions scala-git/src/main/scala/com/madgag/diff/MapDiff.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.madgag.diff

import com.madgag.scala.collection.decorators.MapDecorator
import com.madgag.scala.collection.decorators._

object MapDiff {
def apply[K,V](before: Map[K,V], after: Map[K,V]): MapDiff[K,V] =
Expand All @@ -20,6 +20,6 @@ case class MapDiff[K, V](beforeAndAfter: Map[BeforeAndAfter, Map[K,V]]) {
lazy val unchangedMap: Map[K,V] = beforeAndAfter(Before).view.filterKeys(unchanged).toMap

lazy val changedMap: Map[K,Map[BeforeAndAfter, V]] =
changed.map(k => k -> beforeAndAfter.mapV(_(k)).toMap).toMap
changed.map(k => k -> beforeAndAfter.mapV(_(k))).toMap

}
7 changes: 2 additions & 5 deletions scala-git/src/main/scala/com/madgag/git/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ import org.eclipse.jgit.treewalk.TreeWalk
import org.eclipse.jgit.treewalk.filter.{AndTreeFilter, TreeFilter}
import org.eclipse.jgit.util.FS




package object git {

implicit class RichByteArray(bytes: Array[Byte]) {
Expand Down Expand Up @@ -94,7 +91,7 @@ package object git {
(revWalk, revWalk.getObjectReader)
}

def nonSymbolicRefs = repo.getAllRefs.asScala.values.filterNot(_.isSymbolic)
def nonSymbolicRefs: Iterable[Ref] = repo.getRefDatabase.getRefs.asScala.toSeq.filterNot(_.isSymbolic)

}

Expand Down Expand Up @@ -172,7 +169,7 @@ package object git {
implicit class RichRevObject(revObject: RevObject) {
lazy val typeString = Constants.typeString(revObject.getType)

def toTree(implicit revWalk: RevWalk): Option[RevTree] = treeOrBlobPointedToBy(revObject).right.toOption
def toTree(implicit revWalk: RevWalk): Option[RevTree] = treeOrBlobPointedToBy(revObject).toOption
}

val FileModeNames = Map(
Expand Down

0 comments on commit bd36517

Please sign in to comment.