mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
git remote set-head doesn't work with bare repo
This commit is contained in:
parent
d5b43fc50d
commit
cca64b873b
3
git.sh
3
git.sh
@ -14,7 +14,8 @@ function update_linux_git() {
|
|||||||
echo "==== SYNC $UPSTREAM START ===="
|
echo "==== SYNC $UPSTREAM START ===="
|
||||||
git remote set-url origin "$UPSTREAM"
|
git remote set-url origin "$UPSTREAM"
|
||||||
/usr/bin/timeout -s INT 3600 git remote -v update -p
|
/usr/bin/timeout -s INT 3600 git remote -v update -p
|
||||||
git remote set-head origin --auto
|
head=$(git remote show origin | awk '/HEAD branch:/ {print $NF}')
|
||||||
|
[[ -n "$head" ]] && echo "ref: refs/heads/$head" > HEAD
|
||||||
objs=$(find objects -type f | wc -l)
|
objs=$(find objects -type f | wc -l)
|
||||||
[[ "$objs" -gt 8 ]] && git repack -a -b -d
|
[[ "$objs" -gt 8 ]] && git repack -a -b -d
|
||||||
sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+')
|
sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user