Skip to content

Commit 33c4315

Browse files
committed
Prevent empty commits, closes #527
1 parent 573772b commit 33c4315

File tree

1 file changed

+1
-1
lines changed
  • components/sbm-core/src/main/java/org/springframework/sbm/engine/git

1 file changed

+1
-1
lines changed

components/sbm-core/src/main/java/org/springframework/sbm/engine/git/GitSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public void commitWhenGitAvailable(ProjectContext context, String appliedRecipeN
252252
.map(r -> context.getProjectRootDirectory().relativize(Path.of(r)).toString())
253253
.collect(Collectors.toList());
254254

255-
if (sbmApplicationProperties.isGitSupportEnabled()) {
255+
if (sbmApplicationProperties.isGitSupportEnabled() && (!modifiedResources.isEmpty() || !deletedResources.isEmpty())) {
256256
File repoDir = context.getProjectRootDirectory().toFile();
257257
if (repoExists(repoDir)) {
258258
String commitMessage = "SBM: applied recipe '" + appliedRecipeName + "'";

0 commit comments

Comments
 (0)