mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-07-01 07:22:45 +00:00
[bug fix] git remote set-head doesn't work with bare repo
This commit is contained in:
parent
b72c0e82eb
commit
1681a26ea2
@ -16,7 +16,8 @@ function update_font_git() {
|
|||||||
echo "==== SYNC $repo_dir START ===="
|
echo "==== SYNC $repo_dir 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 || 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=$(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+')
|
||||||
|
@ -14,7 +14,8 @@ function update_cocoapods_git() {
|
|||||||
echo "==== SYNC $repo_dir START ===="
|
echo "==== SYNC $repo_dir 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 || 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=$(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+')
|
||||||
|
@ -10,7 +10,8 @@ function update_repo_git() {
|
|||||||
echo "==== SYNC repo.git START ===="
|
echo "==== SYNC repo.git 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
|
||||||
git repack -a -b -d
|
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+')
|
||||||
sz=$(($sz*1024))
|
sz=$(($sz*1024))
|
||||||
|
@ -12,7 +12,8 @@ function update_homebrew_git() {
|
|||||||
echo "==== SYNC $repo_dir START ===="
|
echo "==== SYNC $repo_dir 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+')
|
||||||
|
3
llvm.sh
3
llvm.sh
@ -12,7 +12,8 @@ function repo_update() {
|
|||||||
echo "==== SYNC $repo_dir START ===="
|
echo "==== SYNC $repo_dir 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