File: repository_submodules.rb

package info (click to toggle)
ruby-gitlab 6.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,824 kB
  • sloc: ruby: 12,742; makefile: 7; sh: 4; javascript: 3
file content (27 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

class Gitlab::Client
  # Defines methods related to repository submodules.
  # @see https://docs.gitlab.com/ce/api/repository_submodules.html
  module RepositorySubmodules
    # Edits an existing repository submodule.
    #
    # @example
    #   Gitlab.edit_file(42, "submodule", {
    #     branch: "branch",
    #     commit_sha: "3ddec28ea23acc5caa5d8331a6ecb2a65fc03e88",
    #     commit_message: "commit message"
    #   })
    #
    # @param  [Integer, String] project The ID or name of a project.
    # @param  [String] submodule full path of submodule to update.
    # @param  [Hash] options A customizable set of options.
    # @param  options [String] :branch the name of the branch to commit changes to.
    # @param  options [String] :commit_sha commit SHA to update the submodule to.
    # @param  options [String] :commit_message commit message text.
    # @return [Gitlab::ObjectifiedHash]
    def edit_submodule(project, submodule, options = {})
      put("/projects/#{url_encode project}/repository/submodules/#{url_encode submodule}", body: options)
    end
  end
end