diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-05-27 21:35:15 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-05-31 12:58:15 +0100 |
commit | 6539061dd349972a00899120f7997efa1e7824cd (patch) | |
tree | ca615e12541cc64e4792c7c131c0b2a4e18771ad /dgit | |
parent | 9a69602bffdc82084152fd322862197c51ea7d1b (diff) |
dgit: Break out deliberately_not_fast_forward (nfc)
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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". |