X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=a67c12cb09ceac540f5d4f359987cbe68abcbd5c;hp=9aadaf0d4753c5231c0d3d6ea95c05311397e4f0;hb=b5c3e33d87675507eff29ba1d5e1c4998b15f3fd;hpb=2ef2809f38beeafcccd904267b82849ddcb17957 diff --git a/dgit b/dgit index 9aadaf0d..a67c12cb 100755 --- a/dgit +++ b/dgit @@ -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 () { @@ -3588,6 +3590,7 @@ sub clone ($) { mkdir $dstdir or fail "create \`$dstdir': $!"; changedir $dstdir; runcmd @git, qw(init -q); + record_maindir(); setup_new_tree(); clone_set_head(); my $giturl = access_giturl(1); @@ -6797,6 +6800,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"};