diff options
author | randx <dmitriy.zaporozhets@gmail.com> | 2012-10-15 20:51:11 +0400 |
---|---|---|
committer | randx <dmitriy.zaporozhets@gmail.com> | 2012-10-15 20:51:11 +0400 |
commit | 809aefb828e0d4b5c06304fcde2dcfced66ab4e9 (patch) | |
tree | 4b74baaa21cd65ee2ac07d6c79e226f75f540340 /lib | |
parent | 47d9732a07ef0aa626efdf745d456bff90fe30f8 (diff) |
Minor improve to UI and code formatting of gitlab web editor
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/file_editor.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/gitlab/file_editor.rb b/lib/gitlab/file_editor.rb index 1d52f16ae7d..64155967ef4 100644 --- a/lib/gitlab/file_editor.rb +++ b/lib/gitlab/file_editor.rb @@ -1,6 +1,9 @@ module Gitlab + # GitLab file editor + # + # It gives you ability to make changes to files + # & commit this changes from GitLab UI. class FileEditor - attr_accessor :user, :project, :ref def initialize(user, project, ref) @@ -35,22 +38,21 @@ module Gitlab r.git.sh "git add ." r.git.sh "git commit -am '#{commit_message}'" output = r.git.sh "git push origin #{ref}" + if output =~ /reject/ return false end end end end - true - end - + protected + def can_edit?(path, last_commit) current_last_commit = @project.commits(ref, path, 1).first.sha last_commit == current_last_commit end - end end |