Use GitFile when modifying packed-refs in tests.
authorDave Borowitz <dborowitz@google.com>
Mon, 26 Jul 2010 17:44:15 +0000 (19:44 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 26 Jul 2010 17:44:15 +0000 (19:44 +0200)
NEWS
dulwich/tests/test_repository.py

diff --git a/NEWS b/NEWS
index 52744be7c1806b7ee8f399ab46a4f27f1a2f7fc8..189b57423d2af5b8367df02294b40c35fb34a871 100644 (file)
--- a/NEWS
+++ b/NEWS
 
   * Clean up file headers. (Dave Borowitz)
 
+ TESTS
+
+  * Use GitFile when modifying packed-refs in tests. (Dave Borowitz)
+
  API CHANGES
 
   * dulwich.pack.write_pack_index_v{1,2} now take a file-like object
index 9b34d13747cbc1940281ca9c3701758f51b7f687..a9bb65313f286f8174d13ce0c1eb7440f850aada 100644 (file)
@@ -26,6 +26,9 @@ import tempfile
 import warnings
 
 from dulwich import errors
+from dulwich.file import (
+    GitFile,
+    )
 from dulwich.object_store import (
     tree_lookup_path,
     )
@@ -767,10 +770,10 @@ class DiskRefsContainerTests(RefsContainerTests, TestCase):
 
     def test_remove_packed_without_peeled(self):
         refs_file = os.path.join(self._repo.path, 'packed-refs')
-        f = open(refs_file)
+        f = GitFile(refs_file)
         refs_data = f.read()
         f.close()
-        f = open(refs_file, 'wb')
+        f = GitFile(refs_file, 'wb')
         f.write('\n'.join(l for l in refs_data.split('\n')
                           if not l or l[0] not in '#^'))
         f.close()