Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-06-11 08:07:29 +0000
committerMichael Keppler2019-06-11 08:07:29 +0000
commit179ed063c6c6a7fdd447299aaf7a04c6177a0805 (patch)
tree8c833f54d5d2007ca6c180ae555d7e4fd552b1d5
parente2640791dd827bcc3f606d86e7c5c8b3999de1d3 (diff)
downloadorg.eclipse.tycho.extras-179ed063c6c6a7fdd447299aaf7a04c6177a0805.tar.gz
org.eclipse.tycho.extras-179ed063c6c6a7fdd447299aaf7a04c6177a0805.tar.xz
org.eclipse.tycho.extras-179ed063c6c6a7fdd447299aaf7a04c6177a0805.zip
Bug 436325 - Make <jgit.ignore> more robust
Currently the documentation requires very careful formatting of the jgit.ignore contents to ensure it works (e.g. no leading whitespace in first line). By trimming both the complete tag content as well as filtering out empty lines we can get rid of those formatting rules, since it works then with any text including leading and trailing whitespace or empty lines. Change-Id: If8c0d60db8621bd782e230c1f435291baf8f275f Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java2
-rw-r--r--tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java5
2 files changed, 5 insertions, 2 deletions
diff --git a/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java b/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java
index ff91305..46da291 100644
--- a/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java
+++ b/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java
@@ -208,7 +208,7 @@ public class JGitBuildTimestampProvider implements BuildTimestampProvider {
if (ignoreDom == null) {
return null;
}
- return ignoreDom.getValue();
+ return ignoreDom.getValue().trim();
}
private String getRelPath(Repository repository, MavenProject project) throws IOException {
diff --git a/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java b/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java
index 33bc083..2c23cfb 100644
--- a/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java
+++ b/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java
@@ -36,7 +36,10 @@ public class PathFilter extends TreeFilter {
StringTokenizer st = new StringTokenizer(filters, "\n\r\f", false);
List<FastIgnoreRule> rules = new ArrayList<>();
while (st.hasMoreTokens()) {
- rules.add(new FastIgnoreRule(st.nextToken().trim()));
+ String trimmed = st.nextToken().trim();
+ if (trimmed.length() > 0) {
+ rules.add(new FastIgnoreRule(trimmed));
+ }
}
this.rules = Collections.unmodifiableList(rules);
} else {

Back to the top