Skip to content

Commit eaf19ad

Browse files
committed
enumerated all cases to make adding new mode easier (just in case)
1 parent a00cf64 commit eaf19ad

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,17 @@ public void loadGitData(@NotNull Properties properties) throws IOException, Mojo
118118
maybePutGitDescribe(properties);
119119
// git.commit.id
120120
switch (commitIdGenerationMode) {
121-
case FULL: put(properties, GitCommitIdMojo.COMMIT_ID_FULL, getCommitId());
122-
default: put(properties, GitCommitIdMojo.COMMIT_ID_FLAT, getCommitId());
121+
case FULL: {
122+
put(properties, GitCommitIdMojo.COMMIT_ID_FULL, getCommitId());
123+
break;
124+
}
125+
case FLAT: {
126+
put(properties, GitCommitIdMojo.COMMIT_ID_FLAT, getCommitId());
127+
break;
128+
}
129+
default: {
130+
throw new MojoExecutionException("Unsupported commitIdGenerationMode: " + commitIdGenerationMode);
131+
}
123132
}
124133
// git.commit.id.abbrev
125134
put(properties, GitCommitIdMojo.COMMIT_ID_ABBREV, getAbbrevCommitId());

0 commit comments

Comments
 (0)