class Agate::Submodule

Overview

A git submodule within a repository.

Defined in:

agate/submodule.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.add_setup(repo : Repository, url : String, path : String, use_gitlink : Bool = true) : Submodule #

Sets up a new submodule for the given URL at the given path. Does not clone the submodule -- only configures it.

sub = Submodule.add_setup(repo, "https://github.com/lib/dep.git", "vendor/dep")
sub.name # => "vendor/dep"

[View source]
def self.lookup(repo : Repository, name : String) : Submodule #

Looks up a submodule by name. Raises on failure.


[View source]

Class Method Detail

def self.lookup?(repo : Repository, name : String) : Submodule | Nil #

Looks up a submodule by name, returning nil if not found.


[View source]

Instance Method Detail

def head_oid : OID | Nil #

Returns the OID recorded in HEAD for this submodule, or nil.


[View source]
def index_oid : OID | Nil #

Returns the OID recorded in the index for this submodule, or nil.


[View source]
def init(overwrite : Bool = false) : Nil #

Initializes the submodule configuration.


[View source]
def name : String #

Returns the submodule name.


[View source]
def path : String #

Returns the submodule path.


[View source]
def reload(force : Bool = false) : Nil #

Reloads the submodule info from disk.


[View source]
def sync : Nil #

Syncs the submodule's remote URL to its local configuration.


[View source]
def url : String | Nil #

Returns the submodule URL, or nil if not set.


[View source]