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>
This commit is contained in:
parent
74e42ce122
commit
64abcc4844
@ -172,7 +172,7 @@ sub repository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (defined $opts{Directory}) {
|
if (defined $opts{Directory}) {
|
||||||
-d $opts{Directory} or throw Error::Simple("Directory not found: $!");
|
-d $opts{Directory} or throw Error::Simple("Directory not found: $opts{Directory} $!");
|
||||||
|
|
||||||
my $search = Git->repository(WorkingCopy => $opts{Directory});
|
my $search = Git->repository(WorkingCopy => $opts{Directory});
|
||||||
my $dir;
|
my $dir;
|
||||||
@ -545,7 +545,7 @@ sub wc_chdir {
|
|||||||
or throw Error::Simple("bare repository");
|
or throw Error::Simple("bare repository");
|
||||||
|
|
||||||
-d $self->wc_path().'/'.$subdir
|
-d $self->wc_path().'/'.$subdir
|
||||||
or throw Error::Simple("subdir not found: $!");
|
or throw Error::Simple("subdir not found: $subdir $!");
|
||||||
# Of course we will not "hold" the subdirectory so anyone
|
# Of course we will not "hold" the subdirectory so anyone
|
||||||
# can delete it now and we will never know. But at least we tried.
|
# can delete it now and we will never know. But at least we tried.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user