[JGIT PATCH 08/12] Fix HunkHeader start line when parsing "@@ -1 +1 @@" style headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In this case we are listing a delta of 1 line but also the
position start is line 1.

Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
---
 .../src/org/spearce/jgit/patch/HunkHeader.java     |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/patch/HunkHeader.java b/org.spearce.jgit/src/org/spearce/jgit/patch/HunkHeader.java
index 842519e..f543aed 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/patch/HunkHeader.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/patch/HunkHeader.java
@@ -152,18 +152,14 @@ void parseHeader(final int end) {
 		old.startLine = -parseBase10(buf, ptr.value, ptr);
 		if (buf[ptr.value] == ',')
 			old.lineCount = parseBase10(buf, ptr.value + 1, ptr);
-		else {
-			old.lineCount = old.startLine;
-			old.startLine = 0;
-		}
+		else
+			old.lineCount = 1;
 
 		newStartLine = parseBase10(buf, ptr.value + 1, ptr);
 		if (buf[ptr.value] == ',')
 			newLineCount = parseBase10(buf, ptr.value + 1, ptr);
-		else {
-			newLineCount = newStartLine;
-			newStartLine = 0;
-		}
+		else
+			newLineCount = 1;
 	}
 
 	int parseBody(final Patch script, final int end) {
-- 
1.6.1.rc2.306.ge5d5e

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux