Refactor Series.new_patch
[stgit/ydirson.git] / contrib / stg-unnew
blob2a382647dda2040d08e756b189642f9a23e0d14c
1 #!/bin/sh
2 set -e
4 # stg-unnew - sort of "reverse an 'stg new'"
6 # Remove the current patch from the stack, keeping its contents as
7 # uncommitted changes.
9 # CAVEAT: running this script on the bottom-most patch fails, since
10 # "stg pick --fold" does not allow this situation.
12 # Copyright (c) 2007 Yann Dirson <ydirson@altern.org>
13 # Subject to the GNU GPL, version 2.
15 patch=$(stg top)
16 stg pop
17 stg pick --fold $patch
18 stg delete $patch