Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks in git worktree #117

Open
sellout opened this issue Jan 9, 2017 · 5 comments
Open

Breaks in git worktree #117

sellout opened this issue Jan 9, 2017 · 5 comments
Labels
bug Something isn't working

Comments

@sellout
Copy link

sellout commented Jan 9, 2017

If I try to load the sbt-microsites plugin on a git worktree in a different dir than my original clone, I get an error like

org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working tree, nor an index
	at org.eclipse.jgit.lib.Repository.getWorkTree(Repository.java:1245)
	at org.eclipse.jgit.treewalk.FileTreeIterator.<init>(FileTreeIterator.java:88)
	at org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:139)
	at com.typesafe.sbt.git.JGit.hasUncommittedChanges(JGit.scala:84)
	at com.typesafe.sbt.SbtGit$$anonfun$buildSettings$8$$anonfun$apply$8.apply(SbtGit.scala:116)
	at com.typesafe.sbt.SbtGit$$anonfun$buildSettings$8$$anonfun$apply$8.apply(SbtGit.scala:116)
	at com.typesafe.sbt.git.DefaultReadableGit.withGit(ReadableGit.scala:35)
	at com.typesafe.sbt.SbtGit$$anonfun$buildSettings$8.apply(SbtGit.scala:116)
	at com.typesafe.sbt.SbtGit$$anonfun$buildSettings$8.apply(SbtGit.scala:116)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:175)
	at sbt.EvaluateSettings$INode.evaluate(INode.scala:135)
	at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:69)
	at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:78)
	at sbt.EvaluateSettings$$anon$3.run(INode.scala:74)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
@sellout
Copy link
Author

sellout commented Jan 25, 2017

So, the root cause of this seems to be a bug in JGit with an unmerged “PR”. Which is used by sbt/sbt-git, which is used by sbt/sbt-ghpages, which is used here.

@raulraja raulraja added the bug Something isn't working label Jan 26, 2017
@raulraja
Copy link
Contributor

@sellout Would using ConsoleGit instead of JGit help as a workaround for this issue? https://github.com/sbt/sbt-git/blob/5c72a29953c529b29f39e1d0e771406a4c05390f/src/main/scala/com/typesafe/sbt/SbtGit.scala#L112

@sellout
Copy link
Author

sellout commented Jan 26, 2017

@raulraja Maaaaaaaybe … I’m not sure if I’m setting that correctly. I tried

SbtGit.GitKeys.gitRunner := sbtgit.ConsoleGitRunner

both at the top level of my build.sbt, and also in my standardSettings (which is used by every subproject).

@raulraja
Copy link
Contributor

@juanpedromoreno any ideas? Maybe one of those in ThisBuild ^^^

@juanpedromoreno
Copy link
Member

Nop, no idea why it's not possible to override that sbt config :( . I'd need more time to look at this issue, and a way to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants