From fef39d7214a11d37dd7b5e570419de5637bdcda4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Oct 2007 13:07:12 -0400 Subject: [PATCH] handle being in a subdir of a repository --- mr | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- 2.39.5