Commit 92a43826 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix issues found by rubocop

parent 0b5a2eef
...@@ -786,7 +786,8 @@ class Repository ...@@ -786,7 +786,8 @@ class Repository
@root_ref ||= cache.fetch(:root_ref) { raw_repository.root_ref } @root_ref ||= cache.fetch(:root_ref) { raw_repository.root_ref }
end end
def commit_dir(user, path, message, branch, def commit_dir(
user, path, message, branch,
author_email: nil, author_name: nil, source_branch: nil) author_email: nil, author_name: nil, source_branch: nil)
update_branch_with_hooks( update_branch_with_hooks(
user, user,
...@@ -806,7 +807,9 @@ class Repository ...@@ -806,7 +807,9 @@ class Repository
end end
end end
def commit_file(user, path, content, message, branch, update, # rubocop:disable Metrics/ParameterLists
def commit_file(
user, path, content, message, branch, update,
author_email: nil, author_name: nil, source_branch: nil) author_email: nil, author_name: nil, source_branch: nil)
update_branch_with_hooks( update_branch_with_hooks(
user, user,
...@@ -830,8 +833,11 @@ class Repository ...@@ -830,8 +833,11 @@ class Repository
Gitlab::Git::Blob.commit(raw_repository, options) Gitlab::Git::Blob.commit(raw_repository, options)
end end
end end
# rubocop:enable Metrics/ParameterLists
def update_file(user, path, content, # rubocop:disable Metrics/ParameterLists
def update_file(
user, path, content,
branch:, previous_path:, message:, branch:, previous_path:, message:,
author_email: nil, author_name: nil, source_branch: nil) author_email: nil, author_name: nil, source_branch: nil)
update_branch_with_hooks( update_branch_with_hooks(
...@@ -861,8 +867,10 @@ class Repository ...@@ -861,8 +867,10 @@ class Repository
end end
end end
end end
# rubocop:enable Metrics/ParameterLists
def remove_file(user, path, message, branch, def remove_file(
user, path, message, branch,
author_email: nil, author_name: nil, source_branch: nil) author_email: nil, author_name: nil, source_branch: nil)
update_branch_with_hooks( update_branch_with_hooks(
user, user,
...@@ -885,14 +893,14 @@ class Repository ...@@ -885,14 +893,14 @@ class Repository
end end
end end
def multi_action(user:, branch:, message:, actions:, def multi_action(
user:, branch:, message:, actions:,
author_email: nil, author_name: nil, source_branch: nil) author_email: nil, author_name: nil, source_branch: nil)
update_branch_with_hooks( update_branch_with_hooks(
user, user,
branch, branch,
source_branch: source_branch) do |ref| source_branch: source_branch) do |ref|
index = rugged.index index = rugged.index
parents = []
last_commit = find_branch(ref).dereferenced_target last_commit = find_branch(ref).dereferenced_target
index.read_tree(last_commit.raw_commit.tree) index.read_tree(last_commit.raw_commit.tree)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment