From: Ian Jackson Date: Tue, 11 Feb 2020 19:11:48 +0000 (+0000) Subject: git-cache-proxy: Tolerate failure to write gc stamp X-Git-Tag: archive/debian/6.1.2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=385b50a02693e2703f3aa93e65a2065582eb96d7;hp=c64b6c5b0493a6d3cbf186ea0126e6b3242dd259;p=chiark-utils.git git-cache-proxy: Tolerate failure to write gc stamp This can happen if the directory no longer exists. Signed-off-by: Ian Jackson --- 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 () {