From d3064cc834e88c9e51cdebe9cdac25903b76f34d Mon Sep 17 00:00:00 2001 From: lujian Date: Fri, 20 Nov 2020 10:32:41 +0800 Subject: [PATCH] Fix: [CocoaPods]Head and objects in .git directory --- cocoapods.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocoapods.sh b/cocoapods.sh index 6b379ea..abb9189 100755 --- a/cocoapods.sh +++ b/cocoapods.sh @@ -15,8 +15,8 @@ function update_cocoapods_git() { git remote set-url origin "$UPSTREAM" /usr/bin/timeout -s INT 3600 git remote -v update -p 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) + [[ -n "$head" ]] && echo "ref: refs/heads/$head" > .git/HEAD + objs=$(find .git/objects -type f | wc -l) [[ "$objs" -gt 8 ]] && git repack -a -b -d sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+') total_size=$(($total_size+1024*$sz))