summaryrefslogtreecommitdiff
path: root/gitolite-sync.in
diff options
context:
space:
mode:
Diffstat (limited to 'gitolite-sync.in')
-rw-r--r--gitolite-sync.in38
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