diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-08-02 19:59:53 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-08-03 09:57:52 +0100 |
commit | de8600f92c856f9a9925ed4754ab136c53827389 (patch) | |
tree | 071bda37e48f233af47281085b170fd147912c32 /dgit | |
parent | 2ef2809f38beeafcccd904267b82849ddcb17957 (diff) |
directory refactoring: most invocations: call record_maintree
We need to call record_maintree so that $maindir and its friends are
set, since we're going to rely on them heavily. Most operations will
need them.
Any operation that is invoked in a git tree should definitely have
this called.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -635,6 +635,7 @@ our %defcfg = ('dgit.default.distro' => 'debian', our %gitcfgs; our @gitcfgsources = qw(cmdline local global system); +our $invoked_in_git_tree = 1; sub git_slurp_config () { # This algoritm is a bit subtle, but this is needed so that for @@ -684,6 +685,7 @@ sub cfg { sub not_necessarily_a_tree () { # needs to be called from pre_* @gitcfgsources = grep { $_ ne 'local' } @gitcfgsources; + $invoked_in_git_tree = 0; } sub access_basedistro__noalias () { @@ -6797,6 +6799,7 @@ $cmd =~ y/-/_/; my $pre_fn = ${*::}{"pre_$cmd"}; $pre_fn->() if $pre_fn; +record_maindir if $invoked_in_git_tree; git_slurp_config(); my $fn = ${*::}{"cmd_$cmd"}; |