chiark / gitweb /
Revert 'Changed rebasing safety check to look for reachability of
[stgit] / stgit / commands / rebase.py
index d132b60bce951d60b724e1fd767822074524fd4c..2f0e6605f7c012e5431077e740fad31c7e276493 100644 (file)
@@ -52,6 +52,10 @@ def func(parser, options, args):
     check_conflicts()
     check_head_top_equal()
 
     check_conflicts()
     check_head_top_equal()
 
+    # ensure an exception is raised before popping on non-existent target
+    if git_id(args[0]) == None:
+        raise GitException, 'Unknown revision: %s' % git_id
+        
     applied = prepare_rebase(real_rebase=True, force=options.force)
     rebase(args[0])
     post_rebase(applied, options.nopush, options.merged)
     applied = prepare_rebase(real_rebase=True, force=options.force)
     rebase(args[0])
     post_rebase(applied, options.nopush, options.merged)