From 0307123e5a72f08f75148fd548d689f165886510 Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Wed, 30 Jul 2014 10:38:53 +0200 Subject: [PATCH] Added toString() methods for better debugging of ignore rules Change-Id: Ie31687faa2df47ecaacace2504c3b4e93f1ea809 Signed-off-by: Andrey Loskutov Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/fnmatch/CharacterHead.java | 5 +++++ .../src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java | 5 +++++ org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java index 699eca968..6211b246f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java @@ -57,4 +57,9 @@ final class CharacterHead extends AbstractHead { return c == expectedCharacter; } + @Override + public String toString() { + return String.valueOf(expectedCharacter); + } + } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java index 6d527d2b2..4a0a03df2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java @@ -56,4 +56,9 @@ final class RestrictedWildCardHead extends AbstractHead { protected final boolean matches(final char c) { return c != excludedCharacter; } + + @Override + public String toString() { + return isStar() ? "*" : "?"; //$NON-NLS-1$ //$NON-NLS-2$ + } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java index 980f2094b..fd095d76d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java @@ -255,4 +255,9 @@ public class IgnoreRule { // We are checking the last part of the segment for which isDirectory has to be considered. return !dirOnly || isDirectory; } + + @Override + public String toString() { + return pattern; + } } \ No newline at end of file