summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorTomasz Zarna <Tomasz.Zarna@pl.ibm.com>2011-12-08 18:11:01 +0100
committerTomasz Zarna <Tomasz.Zarna@pl.ibm.com>2011-12-08 18:11:01 +0100
commiteb5df588d889f33d97efbfc9d465d6cf01da636a (patch)
tree536fab3af2e03e8182ee3d5929adb96e54764ab2 /org.eclipse.jgit
parent2b3d48acc291f62c2c924be810e93e3a2e11615f (diff)
downloadjgit-eb5df588d889f33d97efbfc9d465d6cf01da636a.tar.gz
jgit-eb5df588d889f33d97efbfc9d465d6cf01da636a.zip
Add toString() to HunkHeader
Since FileHeader provides toString() method (via DiffEntry) we could add a similar method to HunkHeader. Change-Id: I7886e5b8f775fa8e8478ac5af37d90b6ef677d8b
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java
index a6ea74eb16..26a71cd4c3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java
@@ -401,4 +401,17 @@ public class HunkHeader {
final int end = s.indexOf('\n', offsets[fileIdx]);
offsets[fileIdx] = end < 0 ? s.length() : end + 1;
}
+
+ @Override
+ public String toString() {
+ StringBuilder buf = new StringBuilder();
+ buf.append("HunkHeader[");
+ buf.append(getOldImage().getStartLine());
+ buf.append(',');
+ buf.append(getOldImage().getLineCount());
+ buf.append("->");
+ buf.append(getNewStartLine()).append(',').append(getNewLineCount());
+ buf.append(']');
+ return buf.toString();
+ }
}