diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-09-10 22:12:49 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-09-10 22:12:49 +0300 |
commit | 8850fb9d671635178c2ef307dcf8df083a7285d6 (patch) | |
tree | d2a64514195199e04386499bf4c843888b43b96e /app/services/projects | |
parent | 7f0a346ecd48e814eb44741ff30edf5eda3413b8 (diff) |
Synchronize the default branch when updating a remote mirror
Diffstat (limited to 'app/services/projects')
-rw-r--r-- | app/services/projects/update_remote_mirror_service.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/services/projects/update_remote_mirror_service.rb b/app/services/projects/update_remote_mirror_service.rb index 591b38b8151..85b9eb02803 100644 --- a/app/services/projects/update_remote_mirror_service.rb +++ b/app/services/projects/update_remote_mirror_service.rb @@ -5,13 +5,14 @@ module Projects attr_reader :errors def execute(remote_mirror) - @errors = [] - return success unless remote_mirror.enabled? + errors = [] + begin remote_mirror.ensure_remote! repository.fetch_remote(remote_mirror.remote_name, no_tags: true) + project.update_root_ref(remote_mirror.remote_name) opts = {} if remote_mirror.only_protected_branches? |