summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2015-12-15 23:18:13 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2015-12-15 23:18:14 -0500
commit9eda23e469491fcf89108d8e439b4b662c813419 (patch)
tree8713b8412ee94b8db034624cbd5fee8ba8468844
parent8b749f7de5882f8098be9d391b15e80b66e089e6 (diff)
parent82edf063117a42779a078361ab448f1da4ebc86d (diff)
downloadjgit-9eda23e469491fcf89108d8e439b4b662c813419.tar.gz
jgit-9eda23e469491fcf89108d8e439b4b662c813419.zip
Merge "BaseRepositoryBuilder should trim CR from .git symref"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
index 45dd7ee1ac..670f9a9e14 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
@@ -109,7 +109,8 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
int pathStart = 8;
int lineEnd = RawParseUtils.nextLF(content, pathStart);
- if (content[lineEnd - 1] == '\n')
+ while (content[lineEnd - 1] == '\n' ||
+ (content[lineEnd - 1] == '\r' && SystemReader.getInstance().isWindows()))
lineEnd--;
if (lineEnd == pathStart)
throw new IOException(MessageFormat.format(