Merge "BaseRepositoryBuilder should trim CR from .git symref"

This commit is contained in:
Shawn Pearce 2015-12-15 23:18:13 -05:00 committed by Gerrit Code Review @ Eclipse.org
commit 9eda23e469
1 changed files with 2 additions and 1 deletions

View File

@ -109,7 +109,8 @@ private static File getSymRef(File workTree, File dotGit, FS fs)
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(