diff options
author | Justin Worthe <justin@jemstep.com> | 2020-03-13 12:35:37 +0200 |
---|---|---|
committer | Justin Worthe <justin@jemstep.com> | 2020-03-13 12:35:37 +0200 |
commit | 8254139ed016e77e20d71e6ea173c02d163e3d24 (patch) | |
tree | f65cca18c7dd4c2f07cd8387690b869cc087f0c2 | |
parent | be5095c0595f4bd62602c9ac921ace783329436f (diff) |
PYKE-11910: Inlined condition so we don't run it if we don't need to
-rw-r--r-- | src/policies.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/policies.rs b/src/policies.rs index 32673f3..2e0009f 100644 --- a/src/policies.rs +++ b/src/policies.rs @@ -336,7 +336,6 @@ fn verify_rebased<G: Git>( let is_merge = git.is_merge_commit(*new_commit_id); let is_mainline = git.is_mainline(ref_name)?; let new_commit = git.find_commit(*new_commit_id, override_tag_pattern)?; - let is_not_fast_forward = !git.is_descendent_of(*new_commit_id, *old_commit_id)?; if !is_mainline { info!( @@ -356,7 +355,7 @@ fn verify_rebased<G: Git>( new_commit_id ); Ok(PolicyResult::Ok) - } else if is_not_fast_forward { + } else if !git.is_descendent_of(*new_commit_id, *old_commit_id)? { info!( "Rebase verification passed for {0}: Commit Id {0} is not a descendent of Commit Id {1}, it is most likely that a force-push has occurred", new_commit_id, |