"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 <cel@netapp.com>
if not force and patches:
raise StackException, \
'Cannot delete: the series still contains patches'
if not force and patches:
raise StackException, \
'Cannot delete: the series still contains patches'
+ Patch(p, self.__patch_dir).delete()
if os.path.exists(self.__applied_file):
os.remove(self.__applied_file)
if os.path.exists(self.__applied_file):
os.remove(self.__applied_file)