summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-08-02 14:20:32 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-08-02 15:56:58 +0100
commitd088ef80cb2c01ba3a98179173f11d32706349a9 (patch)
tree106cb600c42fad916b501766008ced9f70cddf63
parent8b30674d5dbdebb3ad48bff887d99f5c4fea7984 (diff)
Revert "Dgit: Introduce in_workarea and fresh_workarea"
This reverts commit aa073c5bdde68a1ab5026ba4daaf29c8bf361532. These functions are not used on this branch. I originally put them here because I thought dgit would want to use them, but actually it doesn't really. There are no tests for them here and we are about to engage in refactoring which will probably accidentally break them. Instead, delete them. This revert should itself be re-reverted when these functionsn are going to be used. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--Debian/Dgit.pm31
1 files changed, 2 insertions, 29 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index 524ae18..1977666 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -30,7 +30,6 @@ use Digest::SHA;
use Data::Dumper;
use IPC::Open2;
use File::Path;
-use File::Basename;
BEGIN {
use Exporter ();
@@ -60,11 +59,10 @@ BEGIN {
shellquote printcmd messagequote
$negate_harmful_gitattrs
changedir git_slurp_config_src
- playtree_setup
- fresh_playtree in_playtree);
+ playtree_setup);
# implicitly uses $main::us
%EXPORT_TAGS = ( policyflags => [qw(NOFFCHECK FRESHREPO NOCOMMITCHECK)] );
- @EXPORT_OK = ( qw($wa), @{ $EXPORT_TAGS{policyflags} } );
+ @EXPORT_OK = @{ $EXPORT_TAGS{policyflags} };
}
our @EXPORT_OK;
@@ -478,31 +476,6 @@ sub playtree_setup ($) {
close GA or die $!;
}
-our $wa;
our $local_git_cfg;
-sub in_playtree ($;$) {
- my $sub = pop @_; # in_playtree [$twa, sub { ... };]
- # default $twa is global $wa (which caller must, in that case, set)
- # $twa should be relative paths of the form .git/FOO/BAR
- my ($twa) = @_;
- $twa //= $wa;
- changedir $twa or die "$twa $!";
- my $r = eval { $sub->($twa); };
- changedir '../../..' or die "$@; $!";
- die $@ if length $@;
- return $r;
-}
-
-sub fresh_playtree (;$) {
- my ($twa) = @_;
- $twa //= $wa;
- $local_git_cfg //= git_slurp_config_src 'local';
- my $parent = dirname $twa;
- mkdir $parent or $!==EEXIST or fail "failed to mkdir $parent: $!";
- rmtree $twa;
- mkdir $twa or die "$twa $!";
- in_playtree sub { playtree_setup $local_git_cfg; };
-}
-
1;