mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-23 07:16:21 +00:00
Don't open non-binary files as binary
* Don't pen the git config file, and the git ".lock" file as binary. Change-Id: I7b3939658456f2fd0a0500443cdd8d1ee1a4459d
This commit is contained in:
parent
a8d539189e
commit
303a82f33a
@ -697,7 +697,7 @@ class Branch(object):
|
|||||||
self._Set('merge', self.merge)
|
self._Set('merge', self.merge)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
fd = open(self._config.file, 'ab')
|
fd = open(self._config.file, 'a')
|
||||||
try:
|
try:
|
||||||
fd.write('[branch "%s"]\n' % self.name)
|
fd.write('[branch "%s"]\n' % self.name)
|
||||||
if self.remote:
|
if self.remote:
|
||||||
|
@ -46,7 +46,7 @@ if not is_python3():
|
|||||||
def _lwrite(path, content):
|
def _lwrite(path, content):
|
||||||
lock = '%s.lock' % path
|
lock = '%s.lock' % path
|
||||||
|
|
||||||
fd = open(lock, 'wb')
|
fd = open(lock, 'w')
|
||||||
try:
|
try:
|
||||||
fd.write(content)
|
fd.write(content)
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user