From d480fdbaaa072b806ba3782bf9452ffeebab4511 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 15 Aug 2020 00:01:19 -0700 Subject: [PATCH] jobd/update.sh: only update-server-info on ref change If the fetch did not change any refs then it must not have fetched anything hence no need to update the server info since the list of packs must not have changed either. Signed-off-by: Kyle J. McKay --- jobd/update.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jobd/update.sh b/jobd/update.sh index c46083a..daf2e09 100755 --- a/jobd/update.sh +++ b/jobd/update.sh @@ -458,8 +458,6 @@ perms=g+w [ "$cfg_permission_control" != "Hooks" ] || perms=go+w chmod $perms $(find -L objects -maxdepth 1 -type d) 2>/dev/null || : -bang git update-server-info - # We maintain the last refresh date in two places deliberately # so that it's available as part of the config data and also # as a standalone file timestamp that can be accessed without git. @@ -469,6 +467,9 @@ bang config_set lastrefresh "$(date "$datefmt")" # Check to see if any refs changed check_after_refs +# Update server info if any refs changed (if they didn't packs shouldn't have either) +[ -z "$refschanged" ] || bang git update-server-info + # Pack all refs if any changed to keep things as efficient as possible # Project mirror updates do not occur that often therefore this is a win # However, if pack-refs fails for some reason, we can just ignore and continue -- 2.11.4.GIT