summaryrefslogtreecommitdiff
path: root/git-maintenance/dog.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-maintenance/dog.sh')
-rwxr-xr-xgit-maintenance/dog.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/git-maintenance/dog.sh b/git-maintenance/dog.sh
index 757fcc4..7c806b0 100755
--- a/git-maintenance/dog.sh
+++ b/git-maintenance/dog.sh
@@ -31,6 +31,10 @@ echo ""
echo "This script is expected to be kept in sync with:"
echo " ${URLPFX}/dog.sh"
echo ""
+echo "Repository will be broken until download completes, as a quick way to ensure data"
+echo "is still all accessible by redownloading all of it."
+echo "Backup is in .git/bak, must be restored manually."
+echo ""
# 2. mkdir -p .git/encrypted and git init
mkdir -p "$REPONAME"
@@ -39,12 +43,13 @@ if ! [ -d ".git" ]; then git init; fi
git config gc.auto 0
+chown -R "$USER":"$USER" .git
pushd .git
# prevent recreation of existing data
mkdir -p encrypted
mkdir -p bak
-cp -va HEAD refs objects/pack bak
-rm objects/pack/*
+cp --force -a HEAD refs objects/pack bak
+rm --force objects/pack/*
# 3. download .git/encrypted with wget
curl -sfI "$URLPFX"/refs.aes?"$NONCE">/dev/null && wget "$URLPFX"/refs.aes?"$NONCE" -O encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ===="
@@ -61,6 +66,8 @@ do
openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -d -in encrypted/"$encpack" | tar -Jxvf -
done
+chown -R "$USER:$USER" .
+
for pack in objects/pack/*.pack
do
git index-pack "$pack"