chiark / gitweb /
Split brain: Include quilt mode in cache key
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 3f637f133bf9b2a7bd891f6e0c6e271f167e9c91..bee6bcdb7ef56f0379458b656710206efc6896bb 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2578,9 +2578,20 @@ sub quiltify_splitbrain ($$$$$$) {
     local $ENV{GIT_COMMITTER_NAME} =  $authline[0];
     local $ENV{GIT_COMMITTER_EMAIL} = $authline[1];
     local $ENV{GIT_COMMITTER_DATE} =  $authline[2];
+       
     if ($quilt_mode =~ m/gbp|unapplied/ &&
-       ($diffbits->{O2A} & 01) && # some patches
-       !($diffbits->{H2O} & 01)) { # but HEAD is like orig
+       ($diffbits->{H2O} & 01)) {
+       my $msg =
+ "--quilt=$quilt_mode specified, implying patches-unapplied git tree\n".
+ " but git tree differs from orig in upstream files.";
+       if (!stat_exists "debian/patches") {
+           $msg .=
+ "\n ... debian/patches is missing; perhaps this is a patch queue branch?";
+       }  
+       fail $msg;
+    }
+    if ($quilt_mode =~ m/gbp|unapplied/ &&
+       ($diffbits->{O2A} & 01)) { # some patches
        quiltify_splitbrain_needed();
        progress "creating patches-applied version using gbp-pq";
        open STDOUT, ">/dev/null" or die $!;
@@ -3052,6 +3063,7 @@ END
        # we look for an entry whose message is the key for the cache lookup
        my @cachekey = (qw(dgit), $our_version);
        push @cachekey, $upstreamversion;
+       push @cachekey, $quilt_mode;
        push @cachekey, $headref;
 
        push @cachekey, hashfile('fake.dsc');