aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
diff options
context:
space:
mode:
authorMarc Strapetz <marc.strapetz@syntevo.com>2015-10-21 12:03:53 +0200
committerMarc Strapetz <marc.strapetz@syntevo.com>2015-11-03 12:01:11 +0100
commit82edf063117a42779a078361ab448f1da4ebc86d (patch)
tree31b11b3d7d6e8fe6ec70ea7f23a1b98bc4b8235a /org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
parent3601c8cdf116f7bac2f624b46a22cba2e4f14d92 (diff)
downloadjgit-82edf063117a42779a078361ab448f1da4ebc86d.tar.gz
jgit-82edf063117a42779a078361ab448f1da4ebc86d.zip
BaseRepositoryBuilder should trim CR from .git symref
Change-Id: I909c2892100da89f6670ffbf3442f11c9cb7b008 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java')
-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(