Git.pm: Fix Git->repository("/somewhere/totally/elsewhere")
authorPetr Baudis <pasky@suse.cz>
Sun, 25 Jun 2006 01:54:28 +0000 (03:54 +0200)
committerJunio C Hamano <junkio@cox.net>
Mon, 3 Jul 2006 00:14:42 +0000 (17:14 -0700)
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
perl/Git.pm
index 5ec7ef8c246bdcfab725490ce383fee083ff8f82..05814477577d79cfda03b1850402de5c40b8b616 100644 (file)
@@ -178,7 +178,8 @@ sub repository {
                };
 
                if ($dir) {
-                       $opts{Repository} = abs_path($dir);
+                       $dir =~ m#^/# or $dir = $opts{Directory} . '/' . $dir;
+                       $opts{Repository} = $dir;
 
                        # If --git-dir went ok, this shouldn't die either.
                        my $prefix = $search->command_oneline('rev-parse', '--show-prefix');