Skip to content

Commit 64abcc4

Browse files
bookgitster
authored andcommitted
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) <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 74e42ce commit 64abcc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

perl/Git.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ sub repository {
172172
}
173173

174174
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} $!");
176176

177177
my $search = Git->repository(WorkingCopy => $opts{Directory});
178178
my $dir;
@@ -545,7 +545,7 @@ sub wc_chdir {
545545
or throw Error::Simple("bare repository");
546546

547547
-d $self->wc_path().'/'.$subdir
548-
or throw Error::Simple("subdir not found: $!");
548+
or throw Error::Simple("subdir not found: $subdir $!");
549549
# Of course we will not "hold" the subdirectory so anyone
550550
# can delete it now and we will never know. But at least we tried.
551551

0 commit comments

Comments
 (0)