summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2011-11-03 16:19:17 -0400
committerCode Review <codereview-daemon@eclipse.org>2011-11-03 16:19:17 -0400
commit2efbcb7e44bffb3b98548e153118e361befa1639 (patch)
tree9dc09d56ec31174239db7d752f5374858e986196
parentc2e828abd63aeedecf3d5e8663c923808ccc047a (diff)
parenta5f72d6b3bb0d2263c4b20ebf2ef35ef0a20ee9c (diff)
downloadjgit-2efbcb7e44bffb3b98548e153118e361befa1639.tar.gz
jgit-2efbcb7e44bffb3b98548e153118e361befa1639.zip
Merge "Implement Config.Entry.toString() to help debugging"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
index 77ab150c6d..8359997202 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
@@ -1414,6 +1414,7 @@ public class Config {
* The configuration file entry
*/
private static class Entry {
+
/**
* The text content before entry
*/
@@ -1482,6 +1483,20 @@ public class Config {
return false;
return a.equals(b);
}
+
+ @Override
+ public String toString() {
+ if (section == null)
+ return "<empty>";
+ StringBuilder b = new StringBuilder(section);
+ if (subsection != null)
+ b.append(".").append(subsection);
+ if (name != null)
+ b.append(".").append(name);
+ if (value != null)
+ b.append("=").append(value);
+ return b.toString();
+ }
}
private static class StringReader {