diff options
author | James Lopez <james@jameslopez.es> | 2016-02-10 16:56:27 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-02-10 16:56:27 +0300 |
commit | 3753c1e03edb516033b4ef856aed63668de59cf3 (patch) | |
tree | 5afd055252b3bd6e3545f0f522ce168736522e7d /app/services | |
parent | f7c06ecdde1740d3dc61d6b2063af1b41ea4ad95 (diff) | |
parent | 10aa99a30c311c59358d1547ebcbe0f6a92227a7 (diff) |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/cross-reference-notes-forks
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/git_push_service.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb index d7ea30bc315..e3bf14966c8 100644 --- a/app/services/git_push_service.rb +++ b/app/services/git_push_service.rb @@ -18,18 +18,23 @@ class GitPushService def execute(project, user, oldrev, newrev, ref) @project, @user = project, user - project.repository.expire_cache + branch_name = Gitlab::Git.ref_name(ref) + + project.repository.expire_cache(branch_name) if push_remove_branch?(ref, newrev) + project.repository.expire_has_visible_content_cache + @push_commits = [] elsif push_to_new_branch?(ref, oldrev) + project.repository.expire_has_visible_content_cache + # Re-find the pushed commits. if is_default_branch?(ref) # Initial push to the default branch. Take the full history of that branch as "newly pushed". @push_commits = project.repository.commits(newrev) # Ensure HEAD points to the default branch in case it is not master - branch_name = Gitlab::Git.ref_name(ref) project.change_head(branch_name) # Set protection on the default branch if configured |