Method: Gitlab::Git::Repository#submodules

Defined in:
lib/gitlab_git/repository.rb

#submodules(ref) ⇒ Object

Return hash with submodules info for this repository

Ex.

{
  "rack"  => {
    "id" => "c67be4624545b4263184c4a0e8f887efd0a66320",
    "path" => "rack",
    "url" => "git://github.com/chneukirchen/rack.git"
  },
  "encoding" => {
    "id" => ....
  }
}


457
458
459
460
461
462
463
464
465
466
467
# File 'lib/gitlab_git/repository.rb', line 457

def submodules(ref)
  commit = rugged.rev_parse(ref)

  begin
    content = blob_content(commit, ".gitmodules")
  rescue InvalidBlobName
    return {}
  end

  parse_gitmodules(commit, content)
end