chiark / gitweb /
Test suite: import-nonnative: Check that .orig contents match imported trees
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 74de9af15461c53551d42c0fbabd1cb476de0002..89795013c12804a47ddefa9b59caee9adae63194 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1164,7 +1164,7 @@ sub aptget_aptcache () { return @aptcache, qw(-c), $aptget_configpath; }
 
 sub aptget_cache_clean {
     runcmd_ordryrun_local qw(sh -ec),
-       'cd "$1"; pwd; find -atime +30 -type f -print0 | xargs -0r echo rm --',
+       'cd "$1"; find -atime +30 -type f -print0 | xargs -0r rm --',
        'x', $aptget_base;
 }
 
@@ -1693,6 +1693,11 @@ sub git_write_tree () {
     return $tree;
 }
 
+sub git_add_write_tree () {
+    runcmd @git, qw(add -Af .);
+    return git_write_tree();
+}
+
 sub remove_stray_gits () {
     my @gitscmd = qw(find -name .git -prune -print0);
     debugcmd "|",@gitscmd;
@@ -1891,7 +1896,8 @@ END
            push @found_differ, "archive $h->{filename}: ".join "; ", @differ
                if @differ;
        }
-       print "origs $file f.same=$found_same #f._differ=$#found_differ\n";
+       printdebug "origs $file f.same=$found_same".
+           " #f._differ=$#found_differ\n";
        if (@found_differ && !$found_same) {
            fail join "\n",
                "archive contains $file with different checksum",
@@ -5194,8 +5200,7 @@ sub quilt_fixup_multipatch ($$$) {
 
     rmtree '.pc';
 
-    runcmd @git, qw(add -Af .);
-    my $unapplied=git_write_tree();
+    my $unapplied=git_add_write_tree();
     printdebug "fake orig tree object $unapplied\n";
 
     ensuredir '.pc';
@@ -5227,8 +5232,7 @@ END
 
     changedir '../fake';
     rmtree '.pc';
-    runcmd @git, qw(add -Af .);
-    my $oldtiptree=git_write_tree();
+    my $oldtiptree=git_add_write_tree();
     printdebug "fake o+d/p tree object $unapplied\n";
     changedir '../work';