Browse Source

BaseRepositoryBuilder should trim CR from .git symref

Change-Id: I909c2892100da89f6670ffbf3442f11c9cb7b008
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
tags/v4.2.0.201601211800-r
Marc Strapetz 8 years ago
parent
commit
82edf06311

+ 2
- 1
org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java View File

@@ -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(

Loading…
Cancel
Save