Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Oakes <matt@ribot.co.uk>2016-03-15 02:33:00 +0300
committerMatt Oakes <matt@ribot.co.uk>2016-04-29 14:45:15 +0300
commit28dcdb27795de79337df7aeff1107114cdffc2f9 (patch)
treef32671e2eda91e99eba67da189c2f52370da14a1 /app/services/git_push_service.rb
parent10f84f99cb663faae37139495f547bb68bd8aced (diff)
Support supressing text file diffs on the default branch with .gitattributes
This is a combination of 3 commits. - Update the bare repositories info/attributes if the default branch is updated - Check the diff attributes of a file before showing a diff - Update CHANGELOG
Diffstat (limited to 'app/services/git_push_service.rb')
-rw-r--r--app/services/git_push_service.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index 1e1be8cd04b..b7af80055bf 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -42,7 +42,12 @@ class GitPushService < BaseService
# Collect data for this git push
@push_commits = @project.repository.commits_between(params[:oldrev], params[:newrev])
process_commit_messages
+
+ # Update the bare repositories info/attributes file using the contents of the default branches
+ # .gitattributes file
+ update_gitattributes if is_default_branch?
end
+
# Update merge requests that may be affected by this push. A new branch
# could cause the last commit of a merge request to change.
update_merge_requests
@@ -54,6 +59,10 @@ class GitPushService < BaseService
perform_housekeeping
end
+ def update_gitattributes
+ @project.repository.copy_gitattributes(params[:ref])
+ end
+
def update_main_language
# Performance can be bad so for now only check main_language once
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/14937