From 0e823840e8f9580262e1bf5c3815e1f9c35d0b54 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 18 Nov 2019 09:21:17 +0100 Subject: gitolite-sync: do not create default remote if this already exist (might have fallen through regex, though) --- gitolite-sync.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}" "$( -- cgit v1.2.3-70-g09d2