git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jan 11, 2008, 18:11 UTC
Message-ID
<4787B15D.3070105@nrlssc.navy.mil>
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
Next: Junio C Hamano
Message 1 of 3 in “git-relink.perl: warn() instead of die() on directory open failure”
  1. git-relink.perl: warn() instead of die() on directory open failureBrandon Casey, Jan 11, 2008
  2. Junio C HamanoJan 12, 2008
  3. Brandon CaseyJan 12, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.