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.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/snippet_repository.rb b/app/models/snippet_repository.rb
index 8151308125a..2cfb201191d 100644
--- a/app/models/snippet_repository.rb
+++ b/app/models/snippet_repository.rb
@@ -93,7 +93,7 @@ class SnippetRepository < ApplicationRecord
end
def get_last_empty_file_index
- repository.ls_files(nil).inject(0) do |max, file|
+ repository.ls_files(snippet.default_branch).inject(0) do |max, file|
idx = file[EMPTY_FILE_PATTERN, 1].to_i
[idx, max].max
end
@@ -131,3 +131,5 @@ class SnippetRepository < ApplicationRecord
action[:action] == :update && action[:content].nil?
end
end
+
+SnippetRepository.prepend_if_ee('EE::SnippetRepository')