We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44c00c1 commit 915ea20Copy full SHA for 915ea20
mill-git/src/com/goyeau/mill/git/GitVersionModule.scala
@@ -17,9 +17,13 @@ object GitVersionModule extends ExternalModule {
17
18
/** Version derived from git.
19
*/
20
- def version(hashLength: Int = 7, withSnapshotSuffix: Boolean = false): Command[String] =
+ def version(
21
+ hashLength: Int = 7,
22
+ withSnapshotSuffix: Boolean = false,
23
+ gitRoot: Path = workspaceRoot
24
+ ): Command[String] =
25
Task.Command {
- val git = Git.open(workspaceRoot.toIO)
26
+ val git = Git.open(gitRoot.toIO)
27
val status = git.status().call()
28
val isDirty = status.hasUncommittedChanges || !status.getUntracked.isEmpty
29
val snapshotSuffix = if (withSnapshotSuffix) "-SNAPSHOT" else ""
0 commit comments