about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-02 08:32:04 +0000
committerEric Wong <e@80x24.org>2021-01-02 19:38:21 +0000
commit0bd668ac6f15f791b626f5c644d23952c377b200 (patch)
tree69eed213e3f5409e70f62c4f907abb9fc94381b0 /t
parentd893d3c028a7fc442e024e5e5b8ea737945b19b3 (diff)
downloadpublic-inbox-0bd668ac6f15f791b626f5c644d23952c377b200.tar.gz
While the changes to git->qx/git->popen from commit 171a9c24022ad7ef
will be useful for the lei daemon, hiding git error messages from
actual users is probably wrong and we'll just localize GIT_*
vars for testing.
Diffstat (limited to 't')
-rw-r--r--t/lei.t3
-rw-r--r--t/lei_store.t2
2 files changed, 5 insertions, 0 deletions
diff --git a/t/lei.t b/t/lei.t
index 41638950..6f6a5888 100644
--- a/t/lei.t
+++ b/t/lei.t
@@ -23,6 +23,9 @@ my $lei = sub {
 my ($home, $for_destroy) = tmpdir();
 delete local $ENV{XDG_DATA_HOME};
 delete local $ENV{XDG_CONFIG_HOME};
+local $ENV{GIT_COMMITTER_EMAIL} = 'lei@example.com';
+local $ENV{GIT_COMMITTER_NAME} = 'lei user';
+local $ENV{XDG_RUNTIME_DIR} = "$home/xdg_run";
 local $ENV{HOME} = $home;
 local $ENV{FOO} = 'BAR';
 mkdir "$home/xdg_run", 0700 or BAIL_OUT "mkdir: $!";
diff --git a/t/lei_store.t b/t/lei_store.t
index bcebde8e..c9360f8f 100644
--- a/t/lei_store.t
+++ b/t/lei_store.t
@@ -12,6 +12,8 @@ require_ok 'PublicInbox::ExtSearch';
 my ($home, $for_destroy) = tmpdir();
 my $opt = { 1 => \(my $out = ''), 2 => \(my $err = '') };
 my $store_dir = "$home/lst";
+local $ENV{GIT_COMMITTER_EMAIL} = 'lei@example.com';
+local $ENV{GIT_COMMITTER_NAME} = 'lei user';
 my $lst = PublicInbox::LeiStore->new($store_dir, { creat => 1 });
 ok($lst, '->new');
 my $smsg = $lst->add_eml(eml_load('t/data/0001.patch'));