From: Adam Spiers Date: Thu, 10 Nov 2011 22:11:19 +0000 (+0000) Subject: Remove trailing slash from MR_REPO. X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/677f2c478ccc89aa2f30c4407e26bc568d8b5532 Remove trailing slash from MR_REPO. This avoids double slashes in paths used in: (a) the built-in shell code in the __DATA__ section, e.g. svn_test = test -d "$MR_REPO"/.svn git_test = test -d "$MR_REPO"/.git (b) lib/git-fake-bare, e.g. git_fake_bare_test = test -d "$MR_REPO"/refs/heads && test -d "$MR_REPO"/refs/tags && (c) lib/vcsh, e.g. vcsh_test = test -d "$MR_REPO"/refs/heads && test -d "$MR_REPO"/refs/tags && I have audited all uses and cannot see any which depend on the trailing slash being there. (cherry picked from commit 2e350ca416572a37df3393d50c91a02b44d9137b) --- diff --git a/mr b/mr index 3a168d1..fc63605 100755 --- a/mr +++ b/mr @@ -602,7 +602,7 @@ sub action { my $is_checkout=($action eq 'checkout'); my $is_update=($action =~ /update/); - $ENV{MR_REPO}=$dir; + ($ENV{MR_REPO}=$dir) =~ s!/$!!; $ENV{MR_ACTION}=$action; foreach my $testname ("skip", "deleted") {