diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-02 11:41:21 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-02 11:41:21 +0200 |
commit | 8997812626b85ff0838ec60047d17e0c5f2a5aca (patch) | |
tree | 22a7d199ad187919045e05c195304b1687d804e4 /app/services/files | |
parent | 8ad5f0848361b07d3f50f087da942aea63bc9f33 (diff) | |
download | gitlab-ce-8997812626b85ff0838ec60047d17e0c5f2a5aca.tar.gz |
Remove files in web editor using rugged
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/services/files')
-rw-r--r-- | app/services/files/delete_service.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/services/files/delete_service.rb b/app/services/files/delete_service.rb index 1497a0f883b..fabcdc19648 100644 --- a/app/services/files/delete_service.rb +++ b/app/services/files/delete_service.rb @@ -19,14 +19,15 @@ module Files return error("You can only edit text files") end - delete_file_action = Gitlab::Satellite::DeleteFileAction.new(current_user, project, ref, path) - - deleted_successfully = delete_file_action.commit!( - nil, - params[:commit_message] + sha = repository.remove_file( + current_user, + path, + params[:commit_message], + ref ) - if deleted_successfully + if sha + after_commit(sha) success else error("Your changes could not be committed, because the file has been changed") |