diff options
author | Erich Eckner <git@eckner.net> | 2019-11-18 09:21:17 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-11-18 09:21:17 +0100 |
commit | 0e823840e8f9580262e1bf5c3815e1f9c35d0b54 (patch) | |
tree | 9144ab23a689b8f39d87a7840417731572c5e476 | |
parent | e7a58fb147213432aaf75fbb607533ef8d363647 (diff) | |
download | gitolite-sync-0e823840e8f9580262e1bf5c3815e1f9c35d0b54.tar.xz |
gitolite-sync: do not create default remote if this already exist (might have fallen through regex, though)
-rw-r--r-- | gitolite-sync.in | 3 |
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}" "$( |