Browse Source

Merge "BaseRepositoryBuilder should trim CR from .git symref"

stable-4.3
Shawn Pearce 9 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
9eda23e469
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java

3
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 pathStart = 8;
int lineEnd = RawParseUtils.nextLF(content, pathStart); int lineEnd = RawParseUtils.nextLF(content, pathStart);
if (content[lineEnd - 1] == '\n') while (content[lineEnd - 1] == '\n' ||
(content[lineEnd - 1] == '\r' && SystemReader.getInstance().isWindows()))
lineEnd--; lineEnd--;
if (lineEnd == pathStart) if (lineEnd == pathStart)
throw new IOException(MessageFormat.format( throw new IOException(MessageFormat.format(

Loading…
Cancel
Save