summaryrefslogtreecommitdiffstats
path: root/git_refs.py
diff options
context:
space:
mode:
authorRenaud Paquay <rpaquay@google.com>2016-11-01 13:48:15 -0700
committerRenaud Paquay <rpaquay@google.com>2017-08-31 12:13:52 -0700
commit2a4be948788dfe5ae9437b048fba229a96bbff2d (patch)
tree27c700887158c27b819992f507dfb2504dc7d101 /git_refs.py
parent9d743397bfceae24a12a566ac1f4d5f968ba2779 (diff)
downloadgit-repo-2a4be948788dfe5ae9437b048fba229a96bbff2d.tar.gz
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
Diffstat (limited to 'git_refs.py')
-rw-r--r--git_refs.py2
1 files changed, 1 insertions, 1 deletions
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):
139 139
140 def _ReadLoose1(self, path, name): 140 def _ReadLoose1(self, path, name):
141 try: 141 try:
142 fd = open(path, 'rb') 142 fd = open(path)
143 except IOError: 143 except IOError:
144 return 144 return
145 145