From 5a636ab334ec9414052aaf228010f3e43760b733 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Wed, 16 Nov 2005 21:39:30 -0500 Subject: [PATCH] Using delete_patch while deleting a branch is broken "stg branch --force --delete" takes forever, and often leaves the repository in a broken state. The reason for this is the use of stack.delete_patch() to delete the patches before removing the series. The problem is delete_patch() will try to pop the patches, which changes the head link. After the branch deletion is complete, HEAD will point to .git/refs/heads/current-branch, but the contents of current-branch will be the old base of the deleted branch. Signed-off-by: Chuck Lever --- stgit/stack.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stgit/stack.py b/stgit/stack.py index 7c6677d..18b4c6e 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -427,9 +427,8 @@ class Series: if not force and patches: raise StackException, \ 'Cannot delete: the series still contains patches' - patches.reverse() for p in patches: - self.delete_patch(p) + Patch(p, self.__patch_dir).delete() if os.path.exists(self.__applied_file): os.remove(self.__applied_file) -- 2.11.0