From 2a4be948788dfe5ae9437b048fba229a96bbff2d Mon Sep 17 00:00:00 2001 From: Renaud Paquay Date: Tue, 1 Nov 2016 13:48:15 -0700 Subject: Handle Windows line endings when reading binary files Without this change, '.git\HEAD' files, for examples, are sometime read incorrectly resulting in the current branch to be reset to "master" when running a "repo init -b xxx" on an already initialized repository. Change-Id: I48c7ef85ff81626edf156914329a560e14252f2a --- git_refs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git_refs.py') diff --git a/git_refs.py b/git_refs.py index 58c838a6..7feaffb1 100644 --- a/git_refs.py +++ b/git_refs.py @@ -139,7 +139,7 @@ class GitRefs(object): def _ReadLoose1(self, path, name): try: - fd = open(path, 'rb') + fd = open(path) except IOError: return -- cgit v1.2.3-54-g00ecf