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>
elif os.path.isfile(fname):
os.remove(fname)
-
+
class Patch(StgitObject):
"""Basic patch implementation
"""
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)