From 6539061dd349972a00899120f7997efa1e7824cd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 May 2015 21:35:15 +0100 Subject: [PATCH] dgit: Break out deliberately_not_fast_forward (nfc) --- dgit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dgit b/dgit index 759df20e..6e9c3044 100755 --- a/dgit +++ b/dgit @@ -162,6 +162,11 @@ sub deliberately ($) { return !!grep { $_ eq "--deliberately-$enquiry" } @deliberatelies; } +sub deliberately_not_fast_forward () { + deliberately('not-fast-forward') || + deliberately('TEST-not-fast-forward-dgit-only'); +} + #---------- remote protocol support, common ---------- # remote push initiator/responder protocol: @@ -1816,8 +1821,7 @@ sub cmd_push { if (fetch_from_archive()) { if (is_fast_fwd(lrref(), 'HEAD')) { # ok - } elsif (deliberately('not-fast-forward') || - deliberately('TEST-not-fast-forward-dgit-only')) { + } elsif (deliberately_not_fast_forward) { $forceflag = '+'; } else { fail "dgit push: HEAD is not a descendant". -- 2.30.2