Skip to content

Commit

Permalink
fix a deprecation warning
Browse files Browse the repository at this point in the history
it seems sad to fix it by resorting to internal API, but I spent
10 minutes or so trying to find a better way and gave up. if the
internal API ever goes away, we'll find out eventually
  • Loading branch information
SethTisue committed Sep 7, 2024
1 parent 1540258 commit 43083f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/scala/com/github/sbt/git/ConsoleGitRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 43083f8

Please sign in to comment.