chiark / gitweb /
Fix assertion in patch creation
authorCatalin Marinas <catalin.marinas@gmail.com>
Wed, 17 Oct 2007 20:35:01 +0000 (21:35 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 17 Oct 2007 20:35:01 +0000 (21:35 +0100)
Top and bottom can be unrelated if the "commit" argument is true since
new_patch will generate a new commit object anyway. Fix the
corresponding assert.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/stack.py

index 94856b8a5210d639d2973bbc8e7420b0a4f1e96e..f2b2afb4eb10df2171af3649ff26c96a3d44249a 100644 (file)
@@ -145,7 +145,7 @@ class StgitObject:
         elif os.path.isfile(fname):
             os.remove(fname)
 
-    
+
 class Patch(StgitObject):
     """Basic patch implementation
     """
@@ -856,7 +856,7 @@ class Series(PatchSet):
         assert not before_existing or (top and bottom)
         assert not (commit and before_existing)
         assert (top and bottom) or (not top and not bottom)
-        assert not top or (bottom == git.get_commit(top).get_parent())
+        assert commit or (not top or (bottom == git.get_commit(top).get_parent()))
 
         if name != None:
             self.__patch_name_valid(name)