summaryrefslogtreecommitdiff
path: root/gitolite-sync.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-11-18 09:21:17 +0100
committerErich Eckner <git@eckner.net>2019-11-18 09:21:17 +0100
commit0e823840e8f9580262e1bf5c3815e1f9c35d0b54 (patch)
tree9144ab23a689b8f39d87a7840417731572c5e476 /gitolite-sync.in
parente7a58fb147213432aaf75fbb607533ef8d363647 (diff)
downloadgitolite-sync-0e823840e8f9580262e1bf5c3815e1f9c35d0b54.tar.xz
gitolite-sync: do not create default remote if this already exist (might have fallen through regex, though)
Diffstat (limited to 'gitolite-sync.in')
-rw-r--r--gitolite-sync.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/gitolite-sync.in b/gitolite-sync.in
index 9c7bdf0..d22151c 100644
--- a/gitolite-sync.in
+++ b/gitolite-sync.in
@@ -50,7 +50,8 @@ for repository_dir in "${repository_dirs[@]}"; do
| awk '{print $1}' \
| sort -u
)
- if [ -z "${remotes}" ]; then
+ if [ -z "${remotes}" ] \
+ && ! git -C "${path}" remote get-url "${default_remote_name}" >/dev/null 2>&1; then
>&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}" "$(