From 095013f9b8f7cbdbcbeda215c469be3da9e7d2b3 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 8 Jun 2011 11:39:20 +0200 Subject: Fixed critical issue that would cause a string to be passed to methods that expect a stream --- git/refs/log.py | 2 +- git/test/refs/test_reflog.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'git') diff --git a/git/refs/log.py b/git/refs/log.py index 562c6caa..a11ad095 100644 --- a/git/refs/log.py +++ b/git/refs/log.py @@ -127,7 +127,7 @@ class RefLog(list, Serializable): def _read_from_file(self): try: - fmap = file_contents_ro_filepath(self._path, stream=False, allow_mmap=True) + fmap = file_contents_ro_filepath(self._path, stream=True, allow_mmap=True) except OSError: # it is possible and allowed that the file doesn't exist ! return diff --git a/git/test/refs/test_reflog.py b/git/test/refs/test_reflog.py index 271924aa..afa00d92 100644 --- a/git/test/refs/test_reflog.py +++ b/git/test/refs/test_reflog.py @@ -34,9 +34,7 @@ class TestRefLog(TestBase): tdir = tempfile.mktemp(suffix="test_reflogs") os.mkdir(tdir) - # verify we have a ref - with the creation of a new ref, the reflog - # will be created as well - rlp_master_ro = RefLog.path(self.rorepo.heads.master) + rlp_master_ro = RefLog.path(self.rorepo.head) assert os.path.isfile(rlp_master_ro) # simple read -- cgit v1.2.1