From 24f332718f5ad42569114233ae11598a3fa08674 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 30 May 2019 19:06:52 +0200 Subject: gitolite-sync: cleanup --- gitolite-sync.in | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/gitolite-sync.in b/gitolite-sync.in index 21d3621..067b87a 100644 --- a/gitolite-sync.in +++ b/gitolite-sync.in @@ -56,42 +56,8 @@ for repository_dir in "${repository_dirs[@]}"; do continue fi for remote in ${remotes}; do - git -C "${path}" fetch "${remote}" -p - done - branches=$( - git -C "${path}" branch --all \ - | sed ' - s,^.\sremotes/[^/[:space:]]\+/,, - t - d - ' - ) - if [ -n "$(git -C "${path}" tag -l)" ]; then - has_tags=true - else - has_tags=false - fi - if [ -z "${branches}" ] && ! ${has_tags}; then - >&2 printf 'Repository "%s" has no branches and no tags.\n' \ - "${path}" - continue - fi - for remote in ${remotes}; do - if ${has_tags}; then - git -C "${path}" push "${remote}" --tags - fi - if [ -z "${branches}" ]; then - continue - fi - for branch in ${branches}; do - if ! git -C "${path}" branch \ - | sed 's/^.\s//' \ - | grep -qxF "${branch}"; then - git -C "${path}" branch "${branch}" --track "${remote}/${branch}" - fi - git -C "${path}" pull --ff-only "${remote}" "${branch}" 2>/dev/null - git -C "${path}" push "${remote}" "${branch}" - done + git -C "${path}" fetch "${remote}" 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*' + git -C "${path}" push "${remote}" 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*' done done done -- cgit v1.2.3-70-g09d2