From: Scott Worley Date: Fri, 10 Apr 2020 04:44:56 +0000 (-0700) Subject: Verify old rev is an ancestor of new rev X-Git-Tag: 1.0~8 X-Git-Url: http://git.scottworley.com/pinch/commitdiff_plain/7d889b120b4b280ea0bf5daaa546dec067c112e9?ds=inline Verify old rev is an ancestor of new rev --- diff --git a/pinch.py b/pinch.py index 80e631b..774f5f1 100644 --- a/pinch.py +++ b/pinch.py @@ -278,6 +278,17 @@ def git_fetch(v: Verification, channel: Channel) -> None: channel.git_ref]) v.result(process.returncode == 0) + if hasattr(channel, 'old_git_revision'): + v.status('Verifying rev is an ancestor of previous rev %s' % channel.old_git_revision) + process = subprocess.run(['git', + '-C', + channel.git_cachedir, + 'merge-base', + '--is-ancestor', + channel.old_git_revision, + channel.git_revision]) + v.result(process.returncode == 0) + def compare_tarball_and_git( v: Verification,