From a4f233b77479df241bd61dc9ca669219f8e71b45 Mon Sep 17 00:00:00 2001 From: jupblb Date: Thu, 28 May 2026 12:58:18 +0200 Subject: [PATCH] build: support git worktrees in sbt-git The JGit bundled with sbt-git 2.1.0 (5.13.x) cannot read linked git worktrees (where .git is a file containing 'gitdir: ...') and aborts project load with NoWorkTreeException. When the build is loaded from a linked worktree, enable useReadableConsoleGit so sbt-git shells out to the git CLI for read-only operations instead. See https://github.com/sbt/sbt-git/issues/264. --- build.sbt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.sbt b/build.sbt index 839157bd..e1920ff3 100644 --- a/build.sbt +++ b/build.sbt @@ -21,6 +21,13 @@ lazy val V = val kctfork = "0.7.1" } +// sbt-git's bundled JGit can't read linked worktrees; shell out to +// git CLI there. See https://github.com/sbt/sbt-git/issues/264. +if (file(".git").isFile) + Seq(useReadableConsoleGit) +else + Nil + inThisBuild( List( scalaVersion := V.scala213,