X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/c40c3500e2475859f051c750ae9ff5cba2f54000..e45af3d4a0faa3f7c46a0a2a9647ad09f1ba8720:/stgit/stack.py diff --git a/stgit/stack.py b/stgit/stack.py index 26a2fc5..93a3d4e 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -975,6 +975,11 @@ class Series: patch = Patch(name, self.__patch_dir, self.__refs_dir) + # only keep the local changes + if keep and not git.apply_diff(git.get_head(), patch.get_bottom()): + raise StackException, \ + 'Failed to pop patches while preserving the local changes' + git.switch(patch.get_bottom(), keep) # save the new applied list