diff --git a/build.sbt b/build.sbt index d563b68..b3b944c 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,7 @@ startYear := Some(2011) homepage := scmInfo.value map (_.browseUrl) scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-git"), "scm:git:git@github.com:sbt/sbt-git.git")) -crossSbtVersions := List("1.3.13") +crossSbtVersions := List("1.10.2") enablePlugins(GitVersioning, SbtPlugin) git.baseVersion := "1.0" diff --git a/src/main/scala/com/github/sbt/git/ConsoleGitRunner.scala b/src/main/scala/com/github/sbt/git/ConsoleGitRunner.scala index a471e82..0d3f229 100644 --- a/src/main/scala/com/github/sbt/git/ConsoleGitRunner.scala +++ b/src/main/scala/com/github/sbt/git/ConsoleGitRunner.scala @@ -16,9 +16,11 @@ object ConsoleGitRunner extends GitRunner { private lazy val cmd = if(isWindowsShell) Seq("cmd", "/c", "git") else Seq("git") // in order to enable colors we trick git into thinking we're a pager, because it already knows we're not a tty - val colorSupport: Seq[(String, String)] = - if(ConsoleLogger.formatEnabled) Seq("GIT_PAGER_IN_USE" -> "1") + val colorSupport: Seq[(String, String)] = { + import sbt.internal.util.Terminal.console + if(console.isAnsiSupported && console.isColorEnabled) Seq("GIT_PAGER_IN_USE" -> "1") else Seq.empty + } override def apply(args: String*)(cwd: File, log: Logger = ConsoleLogger()): String = { val gitLogger = new GitLogger(log) diff --git a/src/main/scala/com/github/sbt/git/GitPlugin.scala b/src/main/scala/com/github/sbt/git/GitPlugin.scala index 1d99387..1764c30 100644 --- a/src/main/scala/com/github/sbt/git/GitPlugin.scala +++ b/src/main/scala/com/github/sbt/git/GitPlugin.scala @@ -170,7 +170,7 @@ object SbtGit { def useJGit: Setting[_] = ThisBuild / gitRunner := JGitRunner /** Setting to use console git for readable ops, to allow working with git worktrees */ - def useReadableConsoleGit: Setting[_] = useConsoleForROGit in ThisBuild := true + def useReadableConsoleGit: Setting[_] = ThisBuild / useConsoleForROGit := true /** Adapts the project prompt to show the current project name *and* the current git branch. */ def showCurrentGitBranch: Setting[_] = diff --git a/test-project/project/build.properties b/test-project/project/build.properties index 8b697bb..0b699c3 100644 --- a/test-project/project/build.properties +++ b/test-project/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.0 +sbt.version=1.10.2