---
There is obviously a semicolon missing after the try/catch block;
without the semicolon '$opts{Repository} = abs_path($dir);' becomes an
argument to the try function. The code (apparently?) never gets
exercised in any test case, but I don't understand it well enough to
write a test case or determine whether it's correct now.
Hence this patch is not for inclusion (from my end at least). I'm
posting it just FYI and in case anyone wants to take a look.
diff --git a/perl/Git.pm b/perl/Git.pm
index 97e61ef..ea6f13f 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -207,13 +207,13 @@ sub repository {
my $search = Git->repository(Repository => $dir);
try {
$search->command('symbolic-ref', 'HEAD');
} catch Git::Error::Command with {
# Mimick git-rev-parse --git-dir error message:
throw Error::Simple('fatal: Not a git repository');
- }
+ };
$opts{Repository} = abs_path($dir);
}
delete $opts{Directory};
}--
1.5.6.rc2.51.g3f3f7.dirty