From 385b50a02693e2703f3aa93e65a2065582eb96d7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 11 Feb 2020 19:11:48 +0000 Subject: [PATCH] git-cache-proxy: Tolerate failure to write gc stamp This can happen if the directory no longer exists. Signed-off-by: Ian Jackson --- scripts/git-cache-proxy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/git-cache-proxy b/scripts/git-cache-proxy index 35ce5ff..762cacb 100755 --- a/scripts/git-cache-proxy +++ b/scripts/git-cache-proxy @@ -307,8 +307,11 @@ sub readcommand () { sub update_gcstamp ($) { my ($gitdir) = (@_); my $gcdone = "$gitdir/cache-proxy-gc.stamp"; - open GCSTAMP, '>', $gcdone or fail "create $gcdone: $!"; - close GCSTAMP; + if (open GCSTAMP, '>', $gcdone) { + close GCSTAMP; + } else { + $!==ENOENT or fail "create $gcdone: $!"; + } } sub clonefetch () { -- 2.30.2