Git.pm: better error message
Provide the bad directory name alongside with $! Note: $! is set if there is "No such file or directory", but isn't set if the file exists but is not a directory. Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Philippe Bruhat (BooK) committed
Jun 18, 2010 at 01:47 UTC
64abcc48447a976884e74a1efd866a21e06ddeec
1 file changed
+2
-2
perl/Git.pm
+2
-2
@@ -172,7 +172,7 @@ sub repository {
172
}
173
174
if (defined $opts{Directory}) {
175
- -d $opts{Directory} or throw Error::Simple("Directory not found: $!");
175
+ -d $opts{Directory} or throw Error::Simple("Directory not found: $opts{Directory} $!");
176
177
my $search = Git->repository(WorkingCopy => $opts{Directory});
178
my $dir;
@@ -545,7 +545,7 @@ sub wc_chdir {
545
or throw Error::Simple("bare repository");
546
547
-d $self->wc_path().'/'.$subdir
548
- or throw Error::Simple("subdir not found: $!");
548
+ or throw Error::Simple("subdir not found: $subdir $!");
549
# Of course we will not "hold" the subdirectory so anyone
550
# can delete it now and we will never know. But at least we tried.
551