Skip to content

Commit 976f014

Browse files
committed
fix a deprecation warning
1 parent 97d0d35 commit 976f014

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/scala/com/github/sbt/git/ConsoleGitRunner.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ object ConsoleGitRunner extends GitRunner {
1616
private lazy val cmd = if(isWindowsShell) Seq("cmd", "/c", "git") else Seq("git")
1717

1818
// in order to enable colors we trick git into thinking we're a pager, because it already knows we're not a tty
19-
val colorSupport: Seq[(String, String)] =
20-
if(ConsoleLogger.formatEnabled) Seq("GIT_PAGER_IN_USE" -> "1")
19+
val colorSupport: Seq[(String, String)] = {
20+
import sbt.internal.util.Terminal.console
21+
if(console.isAnsiSupported && console.isColorEnabled) Seq("GIT_PAGER_IN_USE" -> "1")
2122
else Seq.empty
23+
}
2224

2325
override def apply(args: String*)(cwd: File, log: Logger = ConsoleLogger()): String = {
2426
val gitLogger = new GitLogger(log)

0 commit comments

Comments
 (0)