git @ Cat's Eye Technologies shelf / 58f1247
Reset local branches to remote during `shelf_mirror_from_git`. Chris Pressey 1 year, 7 months ago
1 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
468468 fi
469469 }
470470
471 _shelf_reset_branches() {
472 branches=`git branch | sed 's/[* ]//g'`
473 for branch in $branches; do
474 echo "git branch -f $branch origin/$branch"
475 git branch -f $branch origin/$branch || return 0
476 done
477 return 1
478 }
479
471480 shelf_mirror_from_git() {
472481 git_prefix="$1"
473482 while read -r line; do
480489 if [ ! -d $dest ]; then
481490 git clone --mirror $url $dest
482491 fi
483 (echo -n "$dest: " && cd $dest && git remote set-url origin $url && git remote update)
492 (echo -n "$dest: " && cd $dest && _shelf_reset_branches && git remote set-url origin $url && git remote update)
484493 done
485494 }
486495