You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2021/09/18 13:01:37 UTC

[sling-org-apache-sling-feature-cpconverter] 02/02: SLING-10823 : Pass in repoinit as a single text

This is an automated email from the ASF dual-hosted git repository.

cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git

commit 35371dfda2156353df4a8fdb9c5d952980f6b156
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sat Sep 18 15:01:29 2021 +0200

    SLING-10823 : Pass in repoinit as a single text
---
 .../feature/cpconverter/features/DefaultFeaturesManager.java      | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java b/src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java
index 2ea9c54..7eab0ab 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java
@@ -120,8 +120,6 @@ public class DefaultFeaturesManager implements FeaturesManager, PackagesEventsEm
 
     private final Stack<String> packageIds = new Stack<>();
 
-    private String lastRepoinitSource;
-
     DefaultFeaturesManager() {
         this(new File(""));
     }
@@ -529,11 +527,7 @@ public class DefaultFeaturesManager implements FeaturesManager, PackagesEventsEm
         }
 
         // prepend source/origin
-        final String newSource = "# origin=".concat(String.join("|", this.packageIds)).concat(" source=").concat(source);
-        if ( !newSource.equals(lastRepoinitSource) ) {
-            lastRepoinitSource = newSource;
-            text = newSource.concat(System.lineSeparator().concat(text));
-        }
+        text = "# origin=".concat(String.join("|", this.packageIds)).concat(" source=").concat(source).concat(System.lineSeparator()).concat(text);
 
         Extension repoInitExtension = getRunMode(runMode).getExtensions().getByName(Extension.EXTENSION_NAME_REPOINIT);
         if (repoInitExtension == null) {