diff options
author | Shawn Pearce <spearce@spearce.org> | 2015-12-15 23:18:13 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2015-12-15 23:18:14 -0500 |
commit | 9eda23e469491fcf89108d8e439b4b662c813419 (patch) | |
tree | 8713b8412ee94b8db034624cbd5fee8ba8468844 | |
parent | 8b749f7de5882f8098be9d391b15e80b66e089e6 (diff) | |
parent | 82edf063117a42779a078361ab448f1da4ebc86d (diff) | |
download | jgit-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.java | 3 |
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( |