From 85e6c2d504b728836f7ffd64007b196b064d2955 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 22 Mar 2018 12:33:31 -0700 Subject: [PATCH] gc.sh: add repack dir links to logs and worktrees When running pack-objects from the repack subdirectory created for use during repacking, the "--reflog" option will not be effective unless it can actually see the logs. Add a link back to the logs directory if one exists so this can happen and the referenced objects can be kept. Unfortunately linked working tree HEAD logs seem to be left out in the cold by the "--reflog" option. Nevertheless, go ahead and add a link back to the worktrees directory if one exists in case a future Git version remedies the problem. Signed-off-by: Kyle J. McKay --- jobd/gc.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobd/gc.sh b/jobd/gc.sh index da9c88a..eb1e44b 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -532,6 +532,8 @@ make_repack_dir() { ln -s ../objects repack/objects ln -s "$PWD/objects/pack/repack" repack/alt/pack ln -s ../../refs repack/refs/refs + ! [ -d logs ] || ln -s ../logs repack/logs + ! [ -d worktrees ] || ln -s ../worktrees repack/worktrees _lines=$(( $(LC_ALL=C wc -l repack/HEAD.orig >repack/packed-refs.extra -- 2.11.4.GIT