]> Sergey Matveev's repositories - public-inbox.git/commitdiff
tests: quiet down commit graph
authorEric Wong <e@80x24.org>
Sun, 24 Nov 2019 00:22:35 +0000 (00:22 +0000)
committerEric Wong <e@80x24.org>
Sun, 24 Nov 2019 21:46:57 +0000 (21:46 +0000)
Newer versions of git enable the commit graph by default.
Since we blow away our temporary directories every test,
generating graphis is a waste and clutters stderr with
"Computing commit graph generation numbers" messages.

MANIFEST
t/.gitconfig [new file with mode: 0644]
t/purge.t
t/replace.t
t/v2mirror.t
t/v2writable.t

index 689d3d4ee21fb5fcc7ebec07ea206de6dc2de381..9475667b6620af3abd06af90da8e843a4df7549d 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -194,6 +194,7 @@ scripts/report-spam
 scripts/slrnspool2maildir
 scripts/ssoma-replay
 scripts/xhdr-num2mid
+t/.gitconfig
 t/address.t
 t/admin.t
 t/altid.t
diff --git a/t/.gitconfig b/t/.gitconfig
new file mode 100644 (file)
index 0000000..645a304
--- /dev/null
@@ -0,0 +1,4 @@
+; this becomes ~/.gitconfig for tests where we use
+; "$ENV{HOME} = '/path/to/worktree/t'" in tests
+[gc]
+       writeCommitGraph = false
index 12644d691f038b3034c97280fb45a3e557f2fc14..db09b731f9cf871d717f6088e7240386c100975a 100644 (file)
--- a/t/purge.t
+++ b/t/purge.t
@@ -11,6 +11,7 @@ foreach my $mod (@mods) {
        plan skip_all => "missing $mod for t/purge.t" if $@;
 };
 use Cwd qw(abs_path); # we need this since we chdir below
+local $ENV{HOME} = abs_path('t');
 my $purge = abs_path('blib/script/public-inbox-purge');
 my ($tmpdir, $for_destroy) = tmpdir();
 use_ok 'PublicInbox::V2Writable';
index 039c6bc6fde54d21eb3558f3ab61c47e8e3b49dd..e9361856aa0c9409f2389caf06f68c1401c9f381 100644 (file)
@@ -6,12 +6,15 @@ use Test::More;
 use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
 require './t/common.perl';
+use Cwd qw(abs_path);
 require_git(2.6); # replace is v2 only, for now...
 foreach my $mod (qw(DBD::SQLite)) {
        eval "require $mod";
        plan skip_all => "$mod missing for $0" if $@;
 }
 
+local $ENV{HOME} = abs_path('t');
+
 sub test_replace ($$$) {
        my ($v, $level, $opt) = @_;
        diag "v$v $level replace";
index 96657fdc830755b26bc8bbf4c6bf6389126fe598..a45a262e59dc7c16ee1b3c7564ddaae8d52e4155 100644 (file)
@@ -4,7 +4,9 @@ use strict;
 use warnings;
 use Test::More;
 require './t/common.perl';
+use Cwd qw(abs_path);
 require_git(2.6);
+local $ENV{HOME} = abs_path('t');
 
 # Integration tests for HTTP cloning + mirroring
 foreach my $mod (qw(Plack::Util Plack::Builder
index 7519b4878585746851526cd998d0828106d91168..8bbcd45aad808e3701953bf7e5e7057173cd7185 100644 (file)
@@ -6,11 +6,13 @@ use Test::More;
 use PublicInbox::MIME;
 use PublicInbox::ContentId qw(content_digest);
 require './t/common.perl';
+use Cwd qw(abs_path);
 require_git(2.6);
 foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
        eval "require $mod";
        plan skip_all => "$mod missing for nntpd.t" if $@;
 }
+local $ENV{HOME} = abs_path('t');
 use_ok 'PublicInbox::V2Writable';
 umask 007;
 my ($inboxdir, $for_destroy) = tmpdir();