chiark / gitweb /
git-debrebase: wip fixes for new no global $playground
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Aug 2017 14:55:19 +0000 (15:55 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jun 2018 11:25:49 +0000 (12:25 +0100)
git-debrebase

index c999dd6..b2c15d6 100755 (executable)
@@ -144,21 +144,19 @@ sub D_PAT_OTH () { return 0x8; } # debian/patches other changes
 
 our $playprefix = 'debrebase';
 our $rd;
+our $workarea;
 
 our @git = qw(git);
 
 sub in_workarea ($) {
     my ($sub) = @_;
-    changedir "$playground/work";
+    changedir $workarea;
     my $r = eval { $sub->(); };
     changedir $maindir;
 }
 
 sub fresh_workarea () {
-    do {
-       local $playground;
-       fresh_playground "$playprefix/work";
-    };
+    $workarea = fresh_playground "$playprefix/work";
     in_workarea sub { playtree_setup };
 }
 
@@ -707,8 +705,7 @@ enabledebug if $debuglevel;
 my $toplevel = cmdoutput @git, qw(rev-parse --show-toplevel);
 chdir $toplevel or die "chdir $toplevel: $!";
 
-fresh_playground $playprefix;
-$rd = ensure_a_playground "playprefix/misc";
+$rd = fresh_playground "$playprefix/misc";
 
 my $cmd = shift @ARGV;
 my $cmdfn = $cmd;