diff options
author | Nick Thomas <nick@gitlab.com> | 2018-03-07 05:02:24 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-03-07 05:02:24 +0300 |
commit | 0649a1f8359930b84d7295272b1f8e32c32c0d2c (patch) | |
tree | 65783a2593cf0286d02650e3f26f666001937339 /app | |
parent | ff00cfe45c744393de5bfcafdcfbd12108cc664f (diff) | |
parent | e9fad3e501f6c8fa7ebc58011e5bf9fff379617e (diff) |
Merge branch 'sh-make-prune-optional-in-git-fetch' into 'master'
Make --prune a configurable parameter in fetching a git remote
See merge request gitlab-org/gitlab-ce!17346
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 1a14afb951a..e6b88320110 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -866,20 +866,20 @@ class Repository raw_repository.ancestor?(ancestor_id, descendant_id) end - def fetch_as_mirror(url, forced: false, refmap: :all_refs, remote_name: nil) + def fetch_as_mirror(url, forced: false, refmap: :all_refs, remote_name: nil, prune: true) unless remote_name remote_name = "tmp-#{SecureRandom.hex}" tmp_remote_name = true end add_remote(remote_name, url, mirror_refmap: refmap) - fetch_remote(remote_name, forced: forced) + fetch_remote(remote_name, forced: forced, prune: prune) ensure remove_remote(remote_name) if tmp_remote_name end - def fetch_remote(remote, forced: false, ssh_auth: nil, no_tags: false) - gitlab_shell.fetch_remote(raw_repository, remote, ssh_auth: ssh_auth, forced: forced, no_tags: no_tags) + def fetch_remote(remote, forced: false, ssh_auth: nil, no_tags: false, prune: true) + gitlab_shell.fetch_remote(raw_repository, remote, ssh_auth: ssh_auth, forced: forced, no_tags: no_tags, prune: prune) end def fetch_source_branch!(source_repository, source_branch, local_ref) |