From: Joey Hess Date: Thu, 11 Oct 2007 17:07:12 +0000 (-0400) Subject: handle being in a subdir of a repository X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/fef39d7214a11d37dd7b5e570419de5637bdcda4 handle being in a subdir of a repository --- diff --git a/mr b/mr index 6c59683..577725d 100755 --- a/mr +++ b/mr @@ -175,6 +175,7 @@ loadconfig($config); #use Data::Dumper; #print Dumper(\%config); +# alias expansion and command stemming my $action=shift @ARGV; if (! exists $knownactions{$action}) { if (exists $alias{$action}) { @@ -192,6 +193,15 @@ if (! exists $knownactions{$action}) { } } +# handle being in a subdir of a repository +foreach my $topdir (sort keys %config) { + foreach my $subdir (sort keys %{$config{$topdir}}) { + if ($directory =~ /^\Q$topdir$subdir\E\//) { + $directory=$topdir.$subdir; + } + } +} + my (@failed, @successful, @skipped); my $first=1; foreach my $topdir (sort keys %config) {