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:
Diffstat (limited to 'app/models/snippet_repository.rb')
-rw-r--r--app/models/snippet_repository.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/snippet_repository.rb b/app/models/snippet_repository.rb
index a262802c8af..6b2fa99d547 100644
--- a/app/models/snippet_repository.rb
+++ b/app/models/snippet_repository.rb
@@ -31,6 +31,11 @@ class SnippetRepository < ApplicationRecord
options[:actions] = transform_file_entries(files)
+ # The Gitaly calls perform HTTP requests for permissions check
+ # Stick to the primary in order to make those requests aware that
+ # primary database must be used to fetch the data
+ self.class.sticking.stick(:user, user.id)
+
capture_git_error { repository.commit_files(user, **options) }
ensure
Gitlab::ExclusiveLease.cancel(lease_key, uuid)