diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-15 17:28:29 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-24 09:55:01 -0600 |
commit | faa2e2df8fb95655ebfb8523689295e223005d9d (patch) | |
tree | b31b33532ddbc7d4966b33e446a27d8c99632261 /app/models/repository.rb | |
parent | 0625af3bcb75b3186a3286eee662a7ff8442f130 (diff) | |
download | gitlab-ce-faa2e2df8fb95655ebfb8523689295e223005d9d.tar.gz |
Rename commit_file, commit_dir and remove_file and update specs
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index b747b71ae68..73256df0591 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -747,7 +747,7 @@ class Repository end # rubocop:disable Metrics/ParameterLists - def commit_dir( + def create_dir( user, path, message:, branch_name:, author_email: nil, author_name: nil, @@ -778,14 +778,12 @@ class Repository # rubocop:enable Metrics/ParameterLists # rubocop:disable Metrics/ParameterLists - def commit_file( + def create_file( user, path, content, - message:, branch_name:, update: true, + message:, branch_name:, author_email: nil, author_name: nil, start_branch_name: nil, start_project: project) - action = update ? :update : :create - multi_action( user: user, message: message, @@ -794,7 +792,7 @@ class Repository author_name: author_name, start_branch_name: start_branch_name, start_project: start_project, - actions: [{ action: action, + actions: [{ action: :create, file_path: path, content: content }]) end @@ -803,7 +801,7 @@ class Repository # rubocop:disable Metrics/ParameterLists def update_file( user, path, content, - message:, branch_name:, previous_path:, + message:, branch_name:, previous_path: nil, author_email: nil, author_name: nil, start_branch_name: nil, start_project: project) action = if previous_path && previous_path != path @@ -828,7 +826,7 @@ class Repository # rubocop:enable Metrics/ParameterLists # rubocop:disable Metrics/ParameterLists - def remove_file( + def delete_file( user, path, message:, branch_name:, author_email: nil, author_name: nil, |