X-Git-Url: http://git.scottworley.com/pinch/blobdiff_plain/8fca6c28975315a042f0544b42cb4a15d8dfa192..17d42dd500b06196b70af99e05e9d0fffaf3f38e:/pinch.py diff --git a/pinch.py b/pinch.py index 80e631b..b3f65c6 100644 --- a/pinch.py +++ b/pinch.py @@ -243,7 +243,9 @@ def git_fetch(v: Verification, channel: Channel) -> None: have_rev = process.returncode == 0 if not have_rev: - v.status('Fetching ref "%s" from %s' % (channel.git_ref, channel.git_repo)) + v.status( + 'Fetching ref "%s" from %s' % + (channel.git_ref, channel.git_repo)) # We don't use --force here because we want to abort and freak out if forced # updates are happening. process = subprocess.run(['git', @@ -278,6 +280,19 @@ 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,