From ff558ec89cceb5018410f17667b71552192cf766 Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Thu, 28 Jun 2018 13:25:22 -0500 Subject: [PATCH] Fix GIT_DIR not always specific enough --- build.gradle | 2 +- src/main/java/com/widen/versioning/VersionGenerator.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 0f92d6a..4642229 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'com.widen.oss' -version = '0.3.0' +version = '0.3.1' sourceCompatibility = 1.8 targetCompatibility = 1.8 diff --git a/src/main/java/com/widen/versioning/VersionGenerator.java b/src/main/java/com/widen/versioning/VersionGenerator.java index 7684643..9efcaf5 100644 --- a/src/main/java/com/widen/versioning/VersionGenerator.java +++ b/src/main/java/com/widen/versioning/VersionGenerator.java @@ -53,7 +53,7 @@ public static String gitDescribe(Settings settings, File projectDir) { .redirectOutput(ProcessBuilder.Redirect.PIPE) .redirectError(ProcessBuilder.Redirect.INHERIT) .directory(projectDir); - processBuilder.environment().put("GIT_DIR", projectDir.getPath()); + processBuilder.environment().put("GIT_DIR", projectDir.getPath() + "/.git"); Process process = processBuilder.start(); String output = IOUtils.toString(process.getInputStream(), Charset.forName("UTF-8"));