chiark / gitweb /
Split brain: Rename $origtree to $unapplied (nfc)
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 299c531214cc5a50efd193bc29de9b7d7fea820f..77f8819ef8858307c636aafbfdd9e956053d1d94 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2533,7 +2533,7 @@ sub quiltify_tree_sentinelfiles ($) {
 }
 
 sub quiltify ($$$) {
-    my ($clogp,$target,$origtree) = @_;
+    my ($clogp,$target,$unapplied) = @_;
 
     # Quilt patchification algorithm
     #
@@ -2932,7 +2932,8 @@ END
     $dscaddfile->($debtar);
     close $fakedsc or die $!;
 
-    runcmd qw(sh -ec), 'exec dpkg-source --no-check -x fake.dsc >/dev/null';
+    runcmd qw(sh -ec),
+        'exec dpkg-source --no-check --skip-patches -x fake.dsc >/dev/null';
 
     my $fakexdir= $package.'-'.(stripepoch $upstreamversion);
     rename $fakexdir, "fake" or die "$fakexdir $!";
@@ -2942,9 +2943,18 @@ END
     remove_stray_gits();
     mktree_in_ud_here();
 
-    changedir '..';
+    rmtree '.pc';
+
+    runcmd @git, qw(add -Af .);
+    my $unapplied=git_write_tree();
+    printdebug "fake orig tree object $unapplied\n";
 
-    my $origtree='';
+    ensuredir '.pc';
+
+    runcmd qw(sh -ec),
+        'exec dpkg-source --before-build . >/dev/null';
+
+    changedir '..';
 
     quilt_fixup_mkwork($headref);
 
@@ -2957,7 +2967,7 @@ END
         rename '../fake/.pc','.pc' or die $!;
     }
 
-    quiltify($clogp,$headref,$origtree);
+    quiltify($clogp,$headref,$unapplied);
 
     if (!open P, '>>', ".pc/applied-patches") {
        $!==&ENOENT or die $!;