Skip to content

Commit 0d17e06

Browse files
author
TheSnoozer
committed
remove logic that was moved to the git-commit-id-plugin-core
1 parent 64d51ee commit 0d17e06

File tree

3 files changed

+0
-322
lines changed

3 files changed

+0
-322
lines changed

src/main/java/pl/project13/maven/git/GitCommitIdMojo.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,24 +1207,10 @@ public void error(String msg, Throwable t) {
12071207
return;
12081208
}
12091209

1210-
dotGitDirectory = lookupGitDirectory();
1211-
if (failOnNoGitDirectory && !directoryExists(dotGitDirectory)) {
1212-
throw new GitCommitIdExecutionException(
1213-
".git directory is not found! Please specify a valid [dotGitDirectory] in your"
1214-
+ " pom.xml");
1215-
}
1216-
12171210
if (gitDescribe == null) {
12181211
gitDescribe = new GitDescribeConfig();
12191212
}
12201213

1221-
if (dotGitDirectory != null) {
1222-
log.info("dotGitDirectory '" + dotGitDirectory.getAbsolutePath() + "'");
1223-
} else {
1224-
log.info("dotGitDirectory is null, aborting execution!");
1225-
return;
1226-
}
1227-
12281214
try {
12291215
commitIdGenerationModeEnum =
12301216
CommitIdGenerationMode.valueOf(commitIdGenerationMode.toUpperCase());
@@ -1503,16 +1489,6 @@ private void appendPropertiesToReactorProjects(LogInterface log, Properties prop
15031489
log.info("Added properties to '" + reactorProjects.size() + "' projects");
15041490
}
15051491

1506-
/**
1507-
* Find the git directory of the currently used project. If it's not already specified, this
1508-
* method will try to find it.
1509-
*
1510-
* @return the File representation of the .git directory
1511-
*/
1512-
private File lookupGitDirectory() throws GitCommitIdExecutionException {
1513-
return new GitDirLocator(project.getBasedir()).lookupGitDirectory(dotGitDirectory);
1514-
}
1515-
15161492
private void logProperties(LogInterface log, Properties propertiesToPublish) {
15171493
for (String propertyName : propertiesToPublish.stringPropertyNames()) {
15181494
log.info("including property '" + propertyName + "' in results");
@@ -1522,8 +1498,4 @@ private void logProperties(LogInterface log, Properties propertiesToPublish) {
15221498
private boolean isPomProject(@Nonnull MavenProject project) {
15231499
return project.getPackaging().equalsIgnoreCase("pom");
15241500
}
1525-
1526-
private boolean directoryExists(@Nullable File fileLocation) {
1527-
return fileLocation != null && fileLocation.exists() && fileLocation.isDirectory();
1528-
}
15291501
}

src/main/java/pl/project13/maven/git/GitDirLocator.java

Lines changed: 0 additions & 174 deletions
This file was deleted.

src/test/java/pl/project13/maven/git/GitDirLocatorTest.java

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)