allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject allura git commit: Make sure temp repo clone always gets cleaned up
Date Fri, 11 Mar 2016 21:18:08 GMT
Repository: allura
Updated Branches:
  refs/heads/master 3d341d1fc -> d5d6d5152


Make sure temp repo clone always gets cleaned up


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d5d6d515
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d5d6d515
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d5d6d515

Branch: refs/heads/master
Commit: d5d6d5152aac86b7eacec3ed52f1fa9a5d2f8a45
Parents: 3d341d1
Author: Dave Brondsema <dave@brondsema.net>
Authored: Tue Mar 8 10:04:51 2016 -0500
Committer: Heith Seewald <heiths@gmail.com>
Committed: Fri Mar 11 16:14:47 2016 -0500

----------------------------------------------------------------------
 ForgeGit/forgegit/model/git_repo.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/d5d6d515/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 7e02905..f74854a 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -716,8 +716,10 @@ class GitImplementation(M.RepositoryImplementation):
         self._git.git.clone('--bare', '--shared', from_path, tmp_path)
         tmp_repo = GitImplementation(Object(full_fs_path=tmp_path))
         log.info('Merge request view - shared clone timing: %s for %s', time()-start_time,
from_path)
-        yield tmp_repo
-        shutil.rmtree(tmp_path, ignore_errors=True)
+        try:
+            yield tmp_repo
+        finally:
+            shutil.rmtree(tmp_path, ignore_errors=True)
 
     def merge_base(self, mr):
         g = self._git.git


Mime
View raw message