Skip to content

Commit 6c06e4f

Browse files
committed
Throw GitVersionException instead if not in a Git repository
This allows this error to be recoverable from GradleUtils, since it is expected for GitVersionExceptions to be caught and potentially recoverable (i.e. using temporary fake versions such as 0.0.0), while IllegalArgumentExceptions should be dealt with accordingly.
1 parent d49e247 commit 6c06e4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/net/minecraftforge/gitver/internal/GitVersionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public GitVersionImpl(File gitDir, File root, File project, GitVersionConfig con
5353
this.gitDir = gitDir;
5454
this.root = root;
5555
if (!this.gitDir.exists())
56-
throw new IllegalArgumentException("Root directory is not a git repository!");
56+
throw new GitVersionExceptionInternal("Root directory is not a git repository!");
5757

5858
this.project = project;
5959
if (this.project.compareTo(this.root) < 0)

0 commit comments

Comments
 (0)