diff --git a/adobe-fonts.sh b/adobe-fonts.sh index 803c7e7..b678491 100755 --- a/adobe-fonts.sh +++ b/adobe-fonts.sh @@ -16,7 +16,8 @@ function update_font_git() { echo "==== SYNC $repo_dir START ====" git remote set-url origin "$UPSTREAM" /usr/bin/timeout -s INT 3600 git remote -v update -p - git remote set-head origin --auto || true + 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" -gt 8 ]] && git repack -a -b -d sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+') diff --git a/cocoapods.sh b/cocoapods.sh index adf5de5..6b379ea 100755 --- a/cocoapods.sh +++ b/cocoapods.sh @@ -14,7 +14,8 @@ function update_cocoapods_git() { echo "==== SYNC $repo_dir START ====" git remote set-url origin "$UPSTREAM" /usr/bin/timeout -s INT 3600 git remote -v update -p - git remote set-head origin --auto || true + 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" -gt 8 ]] && git repack -a -b -d sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+') diff --git a/git-repo.sh b/git-repo.sh index 579187d..3478a5a 100755 --- a/git-repo.sh +++ b/git-repo.sh @@ -10,7 +10,8 @@ function update_repo_git() { echo "==== SYNC repo.git START ====" git remote set-url origin "$UPSTREAM" /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 git repack -a -b -d sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+') sz=$(($sz*1024)) diff --git a/homebrew.sh b/homebrew.sh index a1b7282..f4b3e38 100755 --- a/homebrew.sh +++ b/homebrew.sh @@ -12,7 +12,8 @@ function update_homebrew_git() { echo "==== SYNC $repo_dir START ====" git remote set-url origin "$UPSTREAM" /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" -gt 8 ]] && git repack -a -b -d sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+') diff --git a/llvm.sh b/llvm.sh index cc83902..9384078 100755 --- a/llvm.sh +++ b/llvm.sh @@ -12,7 +12,8 @@ function repo_update() { echo "==== SYNC $repo_dir START ====" git remote set-url origin "$UPSTREAM" /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" -gt 8 ]] && git repack -a -b -d sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+')