From: Joey Hess Date: Sat, 3 Nov 2007 17:59:06 +0000 (-0400) Subject: * Avoid creating parent directory for a checkout that will ultimately be X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/c4d33b212288918c9e1b4c4e56dc8ddd07bc4089 * Avoid creating parent directory for a checkout that will ultimately be skipped. --- diff --git a/debian/changelog b/debian/changelog index 63d81bb..09aef68 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mr (0.12) UNRELEASED; urgency=low + + * Avoid creating parent directory for a checkout that will ultimately be + skipped. + + -- Joey Hess Sat, 03 Nov 2007 13:58:39 -0400 + mr (0.11) unstable; urgency=low * Avoid using commands like git-config and instead use "git config". diff --git a/mr b/mr index 62c6be8..be7d283 100755 --- a/mr +++ b/mr @@ -388,11 +388,6 @@ sub action { #{{{ } $dir=~s/^(.*)\/[^\/]+\/?$/$1/; - - if (! -d $dir) { - print "mr $action: creating parent directory $dir\n" if $verbose; - system("mkdir", "-p", $dir); - } } elsif ($action =~ /update/) { if (! -d $dir) { @@ -401,7 +396,6 @@ sub action { #{{{ } $ENV{MR_REPO}=$dir; - my $skiptest=findcommand("skip", $dir, $topdir, $subdir); my $command=findcommand($action, $dir, $topdir, $subdir); @@ -425,7 +419,12 @@ sub action { #{{{ return SKIPPED; } } - + + if ($action eq 'checkout' && ! -d $dir) { + print "mr $action: creating parent directory $dir\n" if $verbose; + system("mkdir", "-p", $dir); + } + if (! $no_chdir && ! chdir($dir)) { print STDERR "mr $action: failed to chdir to $dir: $!\n"; return FAILED;