class
Agate::Submodule
- Agate::Submodule
- Reference
- Object
Overview
A git submodule within a repository.
Defined in:
agate/submodule.crConstructors
-
.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.
-
.lookup(repo : Repository, name : String) : Submodule
Looks up a submodule by name.
Class Method Summary
-
.lookup?(repo : Repository, name : String) : Submodule | Nil
Looks up a submodule by name, returning nil if not found.
Instance Method Summary
-
#head_oid : OID | Nil
Returns the OID recorded in HEAD for this submodule, or nil.
-
#index_oid : OID | Nil
Returns the OID recorded in the index for this submodule, or nil.
-
#init(overwrite : Bool = false) : Nil
Initializes the submodule configuration.
-
#name : String
Returns the submodule name.
-
#path : String
Returns the submodule path.
-
#reload(force : Bool = false) : Nil
Reloads the submodule info from disk.
-
#sync : Nil
Syncs the submodule's remote URL to its local configuration.
-
#url : String | Nil
Returns the submodule URL, or nil if not set.
Constructor Detail
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"
Looks up a submodule by name. Raises on failure.
Class Method Detail
Looks up a submodule by name, returning nil if not found.
Instance Method Detail
Returns the OID recorded in HEAD for this submodule, or nil.
Returns the OID recorded in the index for this submodule, or nil.