From 1677b2ffc519f347ff27ffd0b82d6c3fc99c4cf1 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 20 Nov 2017 16:39:57 -0800 Subject: [PATCH] gc.sh: remove stale objects/incoming-* crud Since Git v2.11.0 incoming data ends up in a temporary subdirectory of objects. If something untoward happens to that process those temporary directories can be left around using up space. Remove any that are over 12 hours old at gc time. Signed-off-by: Kyle J. McKay --- jobd/gc.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jobd/gc.sh b/jobd/gc.sh index ca90c9b..09486ad 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -418,6 +418,11 @@ remove_crud() { -name "packtmp-?*" -o -name ".tmp-?*-pack*" \ \) -exec rm -f '{}' + || : + # Remove any stale incoming-* object quarantine directories that are + # more than 12 hours old. These are new with Git >= 2.11.0. + find objects -maxdepth 1 -type d -name 'incoming-?*' -mmin +720 \ + -exec rm -rf '{}' + || : + # Remove any stale shallow_* files that are more than 12 hours old. # These can be left behind by Git >= 1.8.4.2 and < 2.0.0 when a client # requests a shallow clone. -- 2.11.4.GIT