diff options
author | Eric Wong <e@80x24.org> | 2023-11-02 09:35:34 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-03 06:39:30 +0000 |
commit | bbccb5f1d90bf9605fc8473cb9f01bc453a82bf9 (patch) | |
tree | bcaab4c47b6ebf6bfbb99332a5906ce36b680925 /lib/PublicInbox/LeiRediff.pm | |
parent | cfe25e6aa966144a9c96d1ba2c301fd5e1bad79b (diff) | |
download | public-inbox-bbccb5f1d90bf9605fc8473cb9f01bc453a82bf9.tar.gz |
This is pretty convenient way to create files for diff generation in both WWW and lei. The test suite should also be able to take advantage of it.
Diffstat (limited to 'lib/PublicInbox/LeiRediff.pm')
-rw-r--r-- | lib/PublicInbox/LeiRediff.pm | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/PublicInbox/LeiRediff.pm b/lib/PublicInbox/LeiRediff.pm index fdff4b4b..35728330 100644 --- a/lib/PublicInbox/LeiRediff.pm +++ b/lib/PublicInbox/LeiRediff.pm @@ -114,12 +114,9 @@ EOM if (!$rw->{-tmp}) { my $d = "$self->{rdtmp}/for_tree.git"; -d $d or PublicInbox::Import::init_bare($d); - my $f = "$d/objects/info/alternates"; # always overwrite - open my $fh, '>', $f or die "open $f: $!"; - for my $git (@{$self->{gits}}) { - print $fh $git->git_path('objects'),"\n"; - } - close $fh or die "close $f: $!"; + # always overwrite + PublicInbox::IO::write_file '>', "$d/objects/info/alternates", + map { $_->git_path('objects')."\n" } @{$self->{gits}}; $rw = PublicInbox::Git->new($d); } my $w = popen_wr(['git', "--git-dir=$rw->{git_dir}", |