aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2017-01-09 10:53:16 +0000
committerSimon McVittie <smcv@debian.org>2017-01-09 13:07:24 +0000
commitc29c230c33fa4c4994d979fa4d6fcdf280ee8dc6 (patch)
treea830bbaea778242808c68962871996f78724d345 /IkiWiki
parentca1b06d599c610643495100186a1786d9c3dcc35 (diff)
downloadikiwiki-c29c230c33fa4c4994d979fa4d6fcdf280ee8dc6.tar
ikiwiki-c29c230c33fa4c4994d979fa4d6fcdf280ee8dc6.tar.gz
Revert "git: Turn $git_dir into a stack"
Now that we have avoided using in_git_dir recursively, we don't need the stack any more. This reverts commit 39b8931ad31fe6b48afdc570caa459a0996c2092.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/git.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 1f10e1a18..a63ec232c 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -154,13 +154,13 @@ sub genwrapper {
}
}
-my @git_dir_stack;
-my $prefix;
+my $git_dir=undef;
+my $prefix=undef;
sub in_git_dir ($$) {
- unshift @git_dir_stack, shift;
+ $git_dir=shift;
my @ret=shift->();
- shift @git_dir_stack;
+ $git_dir=undef;
$prefix=undef;
return @ret;
}
@@ -217,13 +217,13 @@ sub safe_git {
chdir $params{chdir}
or error("cannot chdir to $params{chdir}: $!");
}
- elsif (! @git_dir_stack) {
+ elsif (! defined $git_dir) {
chdir $config{srcdir}
or error("cannot chdir to $config{srcdir}: $!");
}
else {
- chdir $git_dir_stack[0]
- or error("cannot chdir to $git_dir_stack[0]: $!");
+ chdir $git_dir
+ or error("cannot chdir to $git_dir: $!");
}
if ($params{stdout}) {