Make sure that stg uncommit doesn't touch the branch head
[stgit] / stgit / commands / uncommit.py
index 05e49e0..9d2dba9 100644 (file)
@@ -116,7 +116,7 @@ def func(parser, options, args):
             next_commit = get_parent(next_commit)
         patch_nr = len(commits)
 
-    taken_names = set(stack.patchorder.applied + stack.patchorder.unapplied)
+    taken_names = set(stack.patchorder.all)
     if patchnames:
         for pn in patchnames:
             if pn in taken_names:
@@ -136,5 +136,5 @@ def func(parser, options, args):
     for commit, pn in zip(commits, patchnames):
         trans.patches[pn] = commit
     trans.applied = list(reversed(patchnames)) + trans.applied
-    trans.run()
+    trans.run(set_head = False)
     out.done()