@@ -172,12 +172,6 @@ protected interface Callback {
172
172
* The root directory of the repository we want to check.
173
173
*/
174
174
File getDotGitDirectory ();
175
-
176
- /**
177
- * The project root directory.
178
- */
179
- @ Deprecated
180
- File getProjectBaseDir () throws IOException ;
181
175
}
182
176
183
177
protected static void loadBuildData (@ Nonnull Callback cb , @ Nonnull Properties properties ) throws GitCommitIdExecutionException {
@@ -204,27 +198,20 @@ protected static void loadGitData(@Nonnull Callback cb, @Nonnull Properties prop
204
198
}
205
199
206
200
private static void loadGitDataWithNativeGit (@ Nonnull Callback cb , @ Nonnull Properties properties ) throws GitCommitIdExecutionException {
207
- try {
208
- // TODO: Why does this not use dotGitDir.parent or something?
209
- final File basedir = cb .getProjectBaseDir ();
210
-
211
- GitDataProvider nativeGitProvider = NativeGitProvider
212
- .on (basedir , cb .getNativeGitTimeoutInMs (), cb .getLoggerBridge ())
213
- .setPrefixDot (cb .getPrefixDot ())
214
- .setAbbrevLength (cb .getAbbrevLength ())
215
- .setDateFormat (cb .getDateFormat ())
216
- .setDateFormatTimeZone (cb .getDateFormatTimeZone ())
217
- .setGitDescribe (cb .getGitDescribe ())
218
- .setCommitIdGenerationMode (cb .getCommitIdGenerationMode ())
219
- .setUseBranchNameFromBuildEnvironment (cb .getUseBranchNameFromBuildEnvironment ())
220
- .setExcludeProperties (cb .getExcludeProperties ())
221
- .setIncludeOnlyProperties (cb .getIncludeOnlyProperties ())
222
- .setOffline (cb .isOffline ());
223
-
224
- nativeGitProvider .loadGitData (cb .getEvaluateOnCommit (), properties );
225
- } catch (IOException e ) {
226
- throw new GitCommitIdExecutionException (e );
227
- }
201
+ GitDataProvider nativeGitProvider = NativeGitProvider
202
+ .on (cb .getDotGitDirectory ().getParentFile (), cb .getNativeGitTimeoutInMs (), cb .getLoggerBridge ())
203
+ .setPrefixDot (cb .getPrefixDot ())
204
+ .setAbbrevLength (cb .getAbbrevLength ())
205
+ .setDateFormat (cb .getDateFormat ())
206
+ .setDateFormatTimeZone (cb .getDateFormatTimeZone ())
207
+ .setGitDescribe (cb .getGitDescribe ())
208
+ .setCommitIdGenerationMode (cb .getCommitIdGenerationMode ())
209
+ .setUseBranchNameFromBuildEnvironment (cb .getUseBranchNameFromBuildEnvironment ())
210
+ .setExcludeProperties (cb .getExcludeProperties ())
211
+ .setIncludeOnlyProperties (cb .getIncludeOnlyProperties ())
212
+ .setOffline (cb .isOffline ());
213
+
214
+ nativeGitProvider .loadGitData (cb .getEvaluateOnCommit (), properties );
228
215
}
229
216
230
217
private static void loadGitDataWithJGit (@ Nonnull Callback cb , @ Nonnull Properties properties ) throws GitCommitIdExecutionException {
0 commit comments