diff options
author | Erich Eckner <git@eckner.net> | 2019-05-30 19:06:52 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-05-30 19:06:52 +0200 |
commit | 24f332718f5ad42569114233ae11598a3fa08674 (patch) | |
tree | fa03c9b46857011599722ad1b50e71c708ef6a7a /gitolite-sync.in | |
parent | 2b5f1c9f749defeadf768eb231ed2c8a00812f11 (diff) | |
download | gitolite-sync-24f332718f5ad42569114233ae11598a3fa08674.tar.xz |
gitolite-sync: cleanup
Diffstat (limited to 'gitolite-sync.in')
-rw-r--r-- | gitolite-sync.in | 38 |
1 files 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 |