about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-04-07 12:40:51 +0000
committerEric Wong <e@80x24.org>2023-04-07 22:17:21 +0000
commit39b99c2514230f419fae8c2b52a7d55eaad1cd44 (patch)
tree9fd91da5f74839b307bfc42147f797849bc46be3 /script
parent1fc59b952c8e9618abad4ec52888e43f55b8ab77 (diff)
downloadpublic-inbox-39b99c2514230f419fae8c2b52a7d55eaad1cd44.tar.gz
This lets us get rid of some awkwardness around the old API
and single-use subroutines while saving us some LoC.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-convert9
1 files changed, 4 insertions, 5 deletions
diff --git a/script/public-inbox-convert b/script/public-inbox-convert
index 750adca4..96931cbf 100755
--- a/script/public-inbox-convert
+++ b/script/public-inbox-convert
@@ -89,7 +89,8 @@ sub link_or_copy ($$) {
         File::Copy::cp($src, $dst) or die "cp $src, $dst failed: $!\n";
 }
 
-$old->with_umask(sub {
+{
+        my $restore = $old->with_umask;
         my $old_cfg = "$old->{inboxdir}/config";
         local $ENV{GIT_CONFIG} = $old_cfg;
         my $new_cfg = "$new->{inboxdir}/all.git/config";
@@ -110,12 +111,10 @@ $old->with_umask(sub {
         my $desc = "$old->{inboxdir}/description";
         link_or_copy($desc, "$new->{inboxdir}/description") if -e $desc;
         my $clone = "$old->{inboxdir}/cloneurl";
-        if (-e $clone) {
-                warn <<"";
+        warn <<"" if -e $clone;
 $clone may not be valid after migrating to v2, not copying
 
-        }
-});
+}
 my $state = '';
 my $head = $old->{ref_head} || 'HEAD';
 my ($rd, $pid) = $old->git->popen(qw(fast-export --use-done-feature), $head);