summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-25 15:58:17 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-25 15:58:17 -0300
commit39ab842bc2ff1395ed1bf6768ff2a409a33bf3d3 (patch)
tree6ecb8a3c7546d2eda0ba3c23154b3775887746e3
parent000a723d844c0bccfb04cbb32c683cd4d7e7b07e (diff)
downloadgitlab-ce-39ab842bc2ff1395ed1bf6768ff2a409a33bf3d3.tar.gz
Create project repository only when it not exists
-rw-r--r--lib/github/import.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/github/import.rb b/lib/github/import.rb
index fefb713a29e..a0afd12f45f 100644
--- a/lib/github/import.rb
+++ b/lib/github/import.rb
@@ -61,7 +61,7 @@ module Github
def fetch_repository
begin
- project.create_repository
+ project.create_repository unless project.repository.exists?
project.repository.add_remote('github', "https://{options.fetch(:token)}@github.com/#{repo}.git")
project.repository.set_remote_as_mirror('github')
project.repository.fetch_remote('github', forced: true)