chiark / gitweb /
Split brain: introduce quiltmode_splitbrain() (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 29 Nov 2015 18:29:42 +0000 (18:29 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jul 2016 15:47:47 +0000 (16:47 +0100)
dgit

diff --git a/dgit b/dgit
index b22d6ab..fedc7fb 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -200,6 +200,10 @@ sub deliberately_not_fast_forward () {
     }
 }
 
+sub quiltmode_splitbrain () {
+    $quilt_mode =~ m/gbp|dpm|unapplied/;
+}
+
 #---------- remote protocol support, common ----------
 
 # remote push initiator/responder protocol:
@@ -3038,7 +3042,7 @@ END
     close $fakedsc or die $!;
 
     my $splitbrain_cachekey;
-    if ($quilt_mode =~ m/gbp|dpm|unapplied/) {
+    if (quiltmode_splitbrain()) {
        # we look in the reflog of dgit-intern/quilt-cache
        # we look for an entry whose message is the key for the cache lookup
        my @cachekey = (qw(dgit), $our_version);
@@ -3173,7 +3177,7 @@ END
     push @failsuggestion, "Maybe you need to specify one of".
         " --quilt=gbp --quilt=dpm --quilt=unapplied ?";
 
-    if ($splitbrain_cachekey) {
+    if (quiltmode_splitbrain()) {
        quiltify_splitbrain($clogp, $unapplied, $headref,
                             $diffbits, \%editedignores,
                            $splitbrain_cachekey);