From 976f014b4858fdd699c47db2fa82c3d39acbe803 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Sat, 7 Sep 2024 16:46:39 +0200 Subject: [PATCH] fix a deprecation warning --- src/main/scala/com/github/sbt/git/ConsoleGitRunner.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)