git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Git.pm: better error message
@ 2010-06-14  1:00 Philippe Bruhat (BooK)
  2010-06-14  7:10 ` Jeff King
  2010-06-17 23:47 ` Philippe Bruhat (BooK)
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Bruhat (BooK) @ 2010-06-14  1:00 UTC (permalink / raw)
  To: git; +Cc: Philippe Bruhat (BooK)

-d doesn't set $! if the directory doesn't exist

Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org>
---
 perl/Git.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/perl/Git.pm b/perl/Git.pm
index 1926dc9..2a3920b 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -172,7 +172,7 @@ sub repository {
 	}
 
 	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 $dir;
@@ -545,7 +545,7 @@ sub wc_chdir {
 		or throw Error::Simple("bare repository");
 
 	-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
 	# can delete it now and we will never know. But at least we tried.
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-17 23:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-14  1:00 [PATCH] Git.pm: better error message Philippe Bruhat (BooK)
2010-06-14  7:10 ` Jeff King
2010-06-14  9:19   ` Philippe Bruhat (BooK)
2010-06-14  9:20     ` Jeff King
2010-06-17 23:47 ` Philippe Bruhat (BooK)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).