Without this, the space taken by the stale packfiles that gc removes
won't be available to the filesystem until the entire gc run ends (or
the catpipe is otherwise reset).
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
if verbosity:
log('removing ' + basename(p) + '\n')
os.unlink(p)
+ if ns.stale_files: # So git cat-pipe will close them
+ cat_pipe.restart()
ns.stale_files = []
writer = git.PackWriter(objcache_maker=None,
self.p = None
self.inprogress = None
- def _restart(self):
+ def restart(self):
self._abort()
self.p = subprocess.Popen(['git', 'cat-file', '--batch'],
stdin=subprocess.PIPE,
def _fast_get(self, id):
if not self.p or self.p.poll() != None:
- self._restart()
+ self.restart()
assert(self.p)
poll_result = self.p.poll()
assert(poll_result == None)