]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix handling of a repository in "."
authorJoey Hess <joey@gnu.kitenet.net>
Tue, 8 Dec 2009 19:57:50 +0000 (14:57 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Tue, 8 Dec 2009 19:57:50 +0000 (14:57 -0500)
I threw in an abs_path because a repository in "." would turn into
something like "/home/joey/."

I think this is a reasonably safe change.

debian/changelog
mr

index d91b3f9b8a67c5d0add0b9984fb79c939a5aa128..00caea6fe78adc68520f645e432d655ac4aa244e 100644 (file)
@@ -4,6 +4,7 @@ mr (0.45) UNRELEASED; urgency=low
   * bootstrap: Improve stats display.
   * Add --insecure option that can be used to ignore SSL cert errors
     when bootstrapping. (Pavel Avgustinov)
+  * Fix handling of a repository in "."
 
  -- Joey Hess <joeyh@debian.org>  Wed, 25 Nov 2009 17:27:23 -0500
 
diff --git a/mr b/mr
index 620ad7faa000e640d43ee407ae313f3eeb682be4..b5d5c118b8d4ef9c9c470196e64f5214c330a3c4 100755 (executable)
--- a/mr
+++ b/mr
@@ -787,6 +787,13 @@ sub repolist {
        } @list;
 }
 
+sub repodir {
+       my $repo=shift;
+       my $topdir=$repo->{topdir};
+       my $subdir=$repo->{subdir};
+       return abs_path(($subdir =~/^\//) ? $subdir : $topdir.$subdir);
+}
+
 # figure out which repos to act on
 sub selectrepos {
        my @repos;
@@ -795,7 +802,7 @@ sub selectrepos {
                my $subdir=$repo->{subdir};
 
                next if $subdir eq 'DEFAULT';
-               my $dir=($subdir =~/^\//) ? $subdir : $topdir.$subdir;
+               my $dir=repodir($repo);
                my $d=$directory;
                $dir.="/" unless $dir=~/\/$/;
                $d.="/" unless $d=~/\/$/;
@@ -815,7 +822,7 @@ sub selectrepos {
                        my $subdir=$repo->{subdir};
                        
                        next if $subdir eq 'DEFAULT';
-                       my $dir=($subdir =~/^\//) ? $subdir : $topdir.$subdir;
+                       my $dir=repodir($repo);
                        my $d=$directory;
                        $dir.="/" unless $dir=~/\/$/;
                        $d.="/" unless $d=~/\/$/;