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
path: root/lib
diff options
context:
space:
mode:
authorrandx <dmitriy.zaporozhets@gmail.com>2012-10-15 20:51:11 +0400
committerrandx <dmitriy.zaporozhets@gmail.com>2012-10-15 20:51:11 +0400
commit809aefb828e0d4b5c06304fcde2dcfced66ab4e9 (patch)
tree4b74baaa21cd65ee2ac07d6c79e226f75f540340 /lib
parent47d9732a07ef0aa626efdf745d456bff90fe30f8 (diff)
Minor improve to UI and code formatting of gitlab web editor
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/file_editor.rb12
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