git.vfs: fix close method
authorGuido Günther <agx@sigxcpu.org>
Wed, 29 Oct 2014 06:46:35 +0000 (07:46 +0100)
committerGuido Günther <agx@sigxcpu.org>
Wed, 29 Oct 2014 06:47:02 +0000 (07:47 +0100)
Preventing a infinite recursion which can be triggered by gbp pq export
--commit.

gbp/git/vfs.py
tests/test_GitVfs.py

index 81649eb..5d5e132 100644 (file)
@@ -41,7 +41,7 @@ class GitVfs(object):
             return self._data.read(size)
 
         def close(self):
-            return self.close()
+            return self._data.close()
 
     def __init__(self, repo, committish=None):
         """
index 7004db1..8e04954 100644 (file)
@@ -46,6 +46,7 @@ def test_read():
     ''
     >>> gf.readline()
     ''
+    >>> gf.close()
     >>> gbp.git.vfs.GitVfs(repo, 'HEAD').open('foo.txt').read() == content
     True
     >>> gf = vfs.open('doesnotexist')