There were two separate things to fix: bail out if we need a current
patch and there isn't one (because there are no applied patches), and
make sure we don't try to pop patches that don't exist.
Signed-off-by: Karl Hasselström <kha@treskal.com>
if len(args) > 0:
patches = parse_patches(args, all)
else:
if len(args) > 0:
patches = parse_patches(args, all)
else:
- patches = [ crt_series.get_current() ]
+ current = crt_series.get_current()
+ if not current:
+ raise CmdException('No patch applied')
+ patches = [current]
- crt_series.pop_patch(options.to or oldapplied[0])
+ if oldapplied:
+ crt_series.pop_patch(options.to or oldapplied[0])
push_patches(crt_series, patches)
if not options.nopush:
push_patches(crt_series, patches)
if not options.nopush:
-test_expect_failure 'sink a specific patch without applied patches' '
+test_expect_success 'sink a specific patch without applied patches' '
stg sink y &&
test $(echo $(stg applied)) = "y"
'
stg sink y &&
test $(echo $(stg applied)) = "y"
'