summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-12-24 14:57:07 +0200
committerValery Sizov <valery@gitlab.com>2015-12-24 14:57:07 +0200
commit44cf1cbaafa3be1c284f202dcc67c734bbba1a8e (patch)
treec9b5824fd41cc3efa8d4b62b1e7540e729aac6d6 /lib
parent6d0705474791c2071153794e9be8df69375e1028 (diff)
parentd1043c4389cd92d33ff21c3fd994e78cf4d66dba (diff)
downloadgitlab-ce-44cf1cbaafa3be1c284f202dcc67c734bbba1a8e.tar.gz
Merge remote-tracking branch 'origin/master' into emoji-picker-searchemoji-picker-search
Diffstat (limited to 'lib')
-rw-r--r--lib/api/files.rb2
-rw-r--r--lib/gitlab/visibility_level.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb
index a7a768f8895..8ad2c1883c7 100644
--- a/lib/api/files.rb
+++ b/lib/api/files.rb
@@ -7,7 +7,7 @@ module API
def commit_params(attrs)
{
file_path: attrs[:file_path],
- current_branch: attrs[:branch_name],
+ source_branch: attrs[:branch_name],
target_branch: attrs[:branch_name],
commit_message: attrs[:commit_message],
file_content: attrs[:content],
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index 335dc44be19..3160a3c7582 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -51,6 +51,15 @@ module Gitlab
def allowed_fork_levels(origin_level)
[PRIVATE, INTERNAL, PUBLIC].select{ |level| level <= origin_level }
end
+
+ def level_name(level)
+ level_name = 'Unknown'
+ options.each do |name, lvl|
+ level_name = name if lvl == level.to_i
+ end
+
+ level_name
+ end
end
def private?