From e46f1350a9284095b239ce3568a2fe61149c7391 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karl=20Hasselstr=C3=B6m?= Date: Tue, 15 May 2007 21:38:40 +0200 Subject: [PATCH] Remove obsolete files when deleting a branch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Karl Hasselström --- stgit/stack.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stgit/stack.py b/stgit/stack.py index 5e8d2d7..d9c4b99 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -666,6 +666,15 @@ class Series(StgitObject): if os.path.exists(self._dir()+'/orig-base'): os.remove(self._dir()+'/orig-base') + # Remove obsolete files that StGIT no longer uses, but + # that might still be around if this is an old repository. + for obsolete in ([os.path.join(self._dir(), fn) + for fn in ['current', 'description']] + + [os.path.join(self.__base_dir, + 'refs', 'bases', self.__name)]): + if os.path.exists(obsolete): + os.remove(obsolete) + if not os.listdir(self.__patch_dir): os.rmdir(self.__patch_dir) else: -- 2.11.4.GIT