DORMANTno replies

[PATCH] git-relink.perl: warn() instead of die() on directory open failure

From: Brandon Casey <hidden>
Date: 2016-06-15 22:44:04
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Brandon Casey <redacted>
---


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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help