Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ startYear := Some(2011)
homepage := scmInfo.value map (_.browseUrl)
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-git"), "scm:git:[email protected]:sbt/sbt-git.git"))

crossSbtVersions := List("1.3.13")
crossSbtVersions := List("1.10.1")

enablePlugins(GitVersioning, SbtPlugin)
git.baseVersion := "1.0"
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.0
sbt.version=1.10.1
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")
Comment on lines +20 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is safe to use Terminal.console because it seems here that it can stay uninitialized forever.

My suggestion is:

else Seq.empty
}

override def apply(args: String*)(cwd: File, log: Logger = ConsoleLogger()): String = {
val gitLogger = new GitLogger(log)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/github/sbt/git/GitPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,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[_] =
Expand Down
2 changes: 1 addition & 1 deletion test-project/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.0
sbt.version=1.10.1
Loading