summaryrefslogtreecommitdiff
path: root/gitolite-sync.in
diff options
context:
space:
mode:
Diffstat (limited to 'gitolite-sync.in')
-rw-r--r--gitolite-sync.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/gitolite-sync.in b/gitolite-sync.in
index 067b87a..9c7bdf0 100644
--- a/gitolite-sync.in
+++ b/gitolite-sync.in
@@ -51,9 +51,13 @@ for repository_dir in "${repository_dirs[@]}"; do
| sort -u
)
if [ -z "${remotes}" ]; then
- >&2 printf 'Repository "%s" has no backup remotes.\n' \
- "${path}"
- continue
+ >&2 printf 'adding default remote "%s", because no remote was found so far\n' \
+ "${default_remote_name}"
+ git -C "${path}" remote add "${default_remote_name}" "$(
+ printf '%s\n' "${path}" \
+ | sed "${default_remote_path_substitution}"
+ )"
+ remotes="${default_remote_name}"
fi
for remote in ${remotes}; do
git -C "${path}" fetch "${remote}" 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*'