Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k authored Oct 8, 2024
1 parent 05c3a64 commit 61e6b48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/Vcs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ object Git extends VcsCompanion {
protected val markerDirectory = ".git"

def mkVcs(baseDir: File) = new Git(baseDir)

private final case class GitFlag(on: Boolean, flag: String)
}

class Git(val baseDir: File) extends Vcs with GitLike {
val commandName = "git"

import Git.GitFlag

private lazy val trackingBranchCmd = cmd("config", "branch.%s.merge" format currentBranch)
private def trackingBranch: String = trackingBranchCmd.!!.trim.stripPrefix("refs/heads/")
Expand All @@ -143,8 +146,6 @@ class Git(val baseDir: File) extends Vcs with GitLike {

def isBehindRemote = (cmd("rev-list", "%s..%s/%s".format(currentBranch, trackingRemote, trackingBranch)) !! devnull).trim.nonEmpty

private final case class GitFlag(on: Boolean, flag: String)

private def withFlags(flags: Seq[GitFlag])(args: String*): Seq[String] = {
val appended = flags.collect {
case GitFlag(true, flag) => s"-$flag"
Expand Down

0 comments on commit 61e6b48

Please sign in to comment.