Git development
 help / color / mirror / Atom feed
* [PATCH] git-relink.perl: warn() instead of die() on directory open failure
@ 2008-01-11 18:11 Brandon Casey
  2008-01-12  2:14 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Brandon Casey @ 2008-01-11 18:11 UTC (permalink / raw)
  To: Git Mailing List, Junio C Hamano


Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---


Sometimes the repository to link to is not under your control.
If it contains files or unreadable directories, git-relink will
die without this patch.

-brandon


 git-relink.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-relink.perl b/git-relink.perl
index f6b4f6a..391b12d 100755
--- a/git-relink.perl
+++ b/git-relink.perl
@@ -69,7 +69,7 @@ sub do_scan_directory($$$) {
 	my $dfulldir = sprintf("%sobjects/%s/",$dstdir,$subdir);
 
 	opendir(S,$sfulldir)
-		or die "Failed to opendir $sfulldir: $!";
+		or (warn "Failed to opendir $sfulldir: $!" and return);
 
 	foreach my $file (grep(!/\.{1,2}$/, readdir(S))) {
 		my $sfilename = $sfulldir . $file;
-- 
1.5.4.rc2.84.gf85fd-dirty

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

end of thread, other threads:[~2008-01-12  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-11 18:11 [PATCH] git-relink.perl: warn() instead of die() on directory open failure Brandon Casey
2008-01-12  2:14 ` Junio C Hamano
2008-01-12  2:26   ` Brandon Casey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox