From 5c8d4bf8873a0bcfb40898b0dbe6f2484d3d0ca3 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 30 Oct 2009 01:44:01 +0100 Subject: [PATCH] jobs/gc.sh: Simplify cd management, set -e --- jobs/gc.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/jobs/gc.sh b/jobs/gc.sh index 51850ec..4910be5 100755 --- a/jobs/gc.sh +++ b/jobs/gc.sh @@ -2,16 +2,18 @@ . @basedir@/shlib.sh -dir="$1.git" +set -e -progress "+ `date` $dir" +repo="$1" +cd "$cfg_reporoot/$repo.git" + +progress "+ `date` $repo" # safe pruning: we put all our objects to all forks, then we can # safely get rid of extra ones; repacks in forks will get rid of # the redundant ones again then forkdir="$1" if [ -d "$forkdir" ]; then - pushd "$cfg_reporoot/$dir" get_repo_list "$forkdir/" | while read fork; do # Match objects in parent project @@ -21,12 +23,11 @@ if [ -d "$forkdir" ]; then ln -f "$d"/* "$cfg_reporoot/$forkdir/$fork.git/$d" done done - popd fi -git --git-dir="$dir" repack -A -d --window-memory=3G -l -q -git --git-dir="$dir" prune -git --git-dir="$dir" update-server-info -date -R >"$dir/.last_gc" +git repack -A -d --window-memory=3G -l -q +git prune +git update-server-info +date -R >.last_gc -progress "- `date` $dir" +progress "- `date` $repo" -- 2.11.4.GIT