summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorTomasz Zarna2012-03-05 06:59:10 (EST)
committer Tomasz Zarna2012-03-05 06:59:10 (EST)
commiteedd77a97b3eb5c404ac8464ea3a59498a121c72 (patch)
tree8add079921b41aae8b58197fe5a10030cc92198f
parentc71fff4ce2dcd0667d5b1e470f9c34042f0a2cf4 (diff)
downloadjgit-eedd77a97b3eb5c404ac8464ea3a59498a121c72.zip
jgit-eedd77a97b3eb5c404ac8464ea3a59498a121c72.tar.gz
jgit-eedd77a97b3eb5c404ac8464ea3a59498a121c72.tar.bz2
RawText#getEOL() does the same thing as RawText#getLineDelimiter()refs/changes/40/5240/1
The duplication has been introduced when merging I08e1369e142bb19f42a8d7bbb5a7d062cc8533fc and I18adc63596f4657516ccc6d704a561924c79d445. The former should have been manually rebased. It also missed a copyright update in ApplyCommandTest. Change-Id: I18fe6108220f964524fb16b719604222aa7abee6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java19
3 files changed, 2 insertions, 21 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
index dceb0ec..16c0a9b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, 2012, Tomasz Zarna <Tomasz.Zarna@pl.ibm.com>
+ * Copyright (C) 2011, 2012, IBM Corporation and others.
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
index bd489a9..61ed412 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
@@ -228,7 +228,7 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
StringBuilder sb = new StringBuilder();
final String eol = rt.size() == 0
|| (rt.size() == 1 && rt.isMissingNewlineAtEnd()) ? "\n" : rt
- .getEOL();
+ .getLineDelimiter();
for (String l : newLines) {
sb.append(l);
if (eol != null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java
index ddb00d1..f0bf5c6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java
@@ -294,23 +294,4 @@ public class RawText extends Sequence {
else
return "\n";
}
-
- /**
- * Get the EOL chars for the first line.
- *
- * @since 2.0
- * @return the EOL chars or <code>null</code>
- */
- public String getEOL() {
- int e = getEnd(0);
- if (content.length > 1 && content[e - 2] == '\r'
- && content[e - 1] == '\n')
- return "\r\n";
- if (content.length > 0 && content[e - 1] == '\n')
- return "\n";
- if (content.length > 0 && content[e - 1] == '\r')
- return "\r";
- return null;
- }
-
}