summaryrefslogtreecommitdiff
path: root/git-maintenance/get.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-maintenance/get.sh')
-rwxr-xr-xgit-maintenance/get.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/git-maintenance/get.sh b/git-maintenance/get.sh
index 12b8470..a655762 100755
--- a/git-maintenance/get.sh
+++ b/git-maintenance/get.sh
@@ -27,27 +27,29 @@ mkdir -p "$REPONAME"
cd "$REPONAME"
if ! [ -d ".git" ]; then git init; fi
-# prevent recreation of existing data
git config gc.auto 0
-mkdir -p .git/encrypted
-mkdir -p .git/objects/pack.bak
-mv -f .git/objects/pack/* .git/objects/pack.bak/
+pushd .git
+# prevent recreation of existing data
+mkdir -p encrypted
+mkdir -p objects/pack.bak
+mv -f objects/pack/* objects/pack.bak/
# 3. download .git/encrypted with wget
-curl -sfI "$URLPFX"/refs.aes>/dev/null && wget "$URLPFX"/refs.aes -O .git/encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ===="
-openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in .git/encrypted/refs.aes | tar -zxvf -
+curl -sfI "$URLPFX"/refs.aes>/dev/null && wget "$URLPFX"/refs.aes -O encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ===="
+openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in encrypted/refs.aes | tar -zxvf -
-for encpack in $(<.git/encrypted/list.txt)
+for encpack in $(<encrypted/list.txt)
do
wget "$URLPFX"/"$encpack" -O .git/encrypted/"$encpack"
- openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in .git/encrypted/"$encpack" | tar -zxvf - -C .git
+ openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in .git/encrypted/"$encpack" | tar -zxvf -
done
-for pack in .git/objects/pack/*.pack
+for pack in objects/pack/*.pack
do
git index-pack "$pack"
done
+popd
git checkout