summaryrefslogtreecommitdiff
path: root/git-maintenance/get.sh
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-07 17:16:17 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-07 17:16:17 -0800
commitd2f1d006905b5d7c4bdf9255ae050330a6a7fbaa (patch)
tree11fdc170f309640e43e585be9ad82b9f9ec6dd96 /git-maintenance/get.sh
parent4010719395c27d78a60b39c098576cc380d06b2b (diff)
downloadstandingwithresilience-d2f1d006905b5d7c4bdf9255ae050330a6a7fbaa.tar.gz
standingwithresilience-d2f1d006905b5d7c4bdf9255ae050330a6a7fbaa.zip
bugfix attempts
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