mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
Fix: [CocoaPods]Head and objects in .git directory
This commit is contained in:
parent
448f280772
commit
d3064cc834
@ -15,8 +15,8 @@ function update_cocoapods_git() {
|
|||||||
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
|
||||||
head=$(git remote show origin | awk '/HEAD branch:/ {print $NF}')
|
head=$(git remote show origin | awk '/HEAD branch:/ {print $NF}')
|
||||||
[[ -n "$head" ]] && echo "ref: refs/heads/$head" > HEAD
|
[[ -n "$head" ]] && echo "ref: refs/heads/$head" > .git/HEAD
|
||||||
objs=$(find objects -type f | wc -l)
|
objs=$(find .git/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+')
|
||||||
total_size=$(($total_size+1024*$sz))
|
total_size=$(($total_size+1024*$sz))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user