Submodule.addSetup Async

Submodule.addSetup(repo, url, path, use_gitlink).then(function(submodule) {
  // Use submodule
});
Parameters Type  
repo Repository The repository in which you want to create the submodule
url String URL for the submodule’s remote
path String Path at which the submodule should be created
use_gitlink Number Should workdir contain a gitlink to the repo in .git/modules vs. repo directly in workdir.
Returns  
Submodule The newly created submodule ready to open for clone

Submodule.foreach Async

Submodule.foreach(repo, callback, payload).then(function(result) {
  // Use result
});
Parameters Type  
repo Repository The repository
callback SubmoduleCb Function to be called with the name of each submodule. Return a non-zero value to terminate the iteration.
payload Void Extra data to pass to callback
Returns  
Number 0 on success, -1 on error, or non-zero return value of callback

Submodule.lookup Async

Submodule.lookup(repo, name).then(function(submodule) {
  // Use submodule
});
Parameters Type  
repo Repository The parent repository
name String The name of or path to the submodule; trailing slashes okay
Returns  
Submodule Output ptr to submodule; pass NULL to just get return code

Submodule.resolveUrl Async

Submodule.resolveUrl(repo, url).then(function(buf) {
  // Use buf
});
Parameters Type  
repo Repository Pointer to repository object
url String Relative url
Returns  
Buf buffer to store the absolute submodule url in

Submodule.setBranch Sync

var result = Submodule.setBranch(repo, name, branch);
Parameters Type  
repo Repository the repository to affect
name String the name of the submodule to configure
branch String Branch that should be used for the submodule

| Returns | | | — | — | | Number | 0 on success, < 0 on failure |

Submodule.setFetchRecurseSubmodules Sync

var result = Submodule.setFetchRecurseSubmodules(repo, name, fetch_recurse_submodules);
Parameters Type  
repo Repository the repository to affect
name String the submodule to configure
fetch_recurse_submodules Number Boolean value
Returns  
Number old value for fetchRecurseSubmodules

Submodule.setIgnore Async

Submodule.setIgnore(repo, name, ignore).then(function(result) {
  // Use result
});
Parameters Type  
repo Repository the repository to affect
name String the name of the submdule
ignore Number The new value for the ignore rule
Returns  
Number 0 or an error code

Submodule.setUpdate Async

Submodule.setUpdate(repo, name, update).then(function(result) {
  // Use result
});
Parameters Type  
repo Repository the repository to affect
name String the name of the submodule to configure
update Number The new value to use
Returns  
Number 0 or an error code

Submodule.setUrl Async

Submodule.setUrl(repo, name, url).then(function(result) {
  // Use result
});
Parameters Type  
repo Repository the repository to affect
name String the name of the submodule to configure
url String URL that should be used for the submodule

| Returns | | | — | — | | Number | 0 on success, < 0 on failure |

Submodule.status Async

Submodule.status(repo, name, ignore).then(function(result) {
  // Use result
});
Parameters Type  
repo Repository the repository in which to look
name String name of the submodule
ignore Number the ignore rules to follow
Returns  
Number Combination of GIT_SUBMODULE_STATUS flags

Submodule#addFinalize Async

submodule.addFinalize().then(function(result) {
  // Use result
});
Returns  
Number  

Submodule#addToIndex Async

submodule.addToIndex(write_index).then(function(result) {
  // Use result
});
Parameters Type  
write_index Number Boolean if this should immediately write the index file. If you pass this as false, you will have to get the git_index and explicitly call git_index_write() on it to save the change.

| Returns | | | — | — | | Number | 0 on success, < 0 on failure |

Submodule#branch Sync

var string = submodule.branch();
Returns  
String  

Submodule#fetchRecurseSubmodules Sync

var result = submodule.fetchRecurseSubmodules();
Returns  
Number 0 if fetchRecurseSubmodules is false, 1 if true

Submodule#headId Sync

var oid = submodule.headId();
Returns  
Oid  

Submodule#ignore Sync

var result = submodule.ignore();
Returns  
Number The current git_submodule_ignore_t valyue what will be used for
this submodule.  

Submodule#indexId Sync

var oid = submodule.indexId();
Returns  
Oid  

Submodule#init Async

submodule.init(overwrite).then(function(result) {
  // Use result
});
Parameters Type  
overwrite Number By default, existing entries will not be overwritten, but setting this to true forces them to be updated.

| Returns | | | — | — | | Number | 0 on success, < 0 on failure. |

Submodule#location Async

submodule.location().then(function(result) {
  // Use result
});
Returns  
Number Combination of first four GIT_SUBMODULE_STATUS flags

Submodule#name Sync

var string = submodule.name();
Returns  
String  

Submodule#open Async

submodule.open().then(function(repository) {
  // Use repository
});
Returns  
Repository  

Submodule#owner Sync

var repository = submodule.owner();
Returns  
Repository  

Submodule#path Sync

var string = submodule.path();
Returns  
String  

Submodule#reload Sync

var result = submodule.reload(force);
Parameters Type  
force Number Force reload even if the data doesn’t seem out of date

| Returns | | | — | — | | Number | 0 on success, < 0 on error |

Submodule#repoInit Async

submodule.repoInit(use_gitlink).then(function(repository) {
  // Use repository
});
Parameters Type  
use_gitlink Number Should the workdir contain a gitlink to the repo in .git/modules vs. repo directly in workdir.
Returns  
Repository  

Submodule#sync Async

submodule.sync().then(function(result) {
  // Use result
});
Returns  
Number  

Submodule#update Async

submodule.update(init, options).then(function(number) {
  // Use number
});

Updates a submodule

Parameters Type  
init Number Setting this to 1 will initialize submodule before updating
options SubmoduleUpdateOptions Submodule update settings
Returns  
Number 0 on success, any non-zero return value from a callback

Submodule#updateStrategy Sync

var result = submodule.updateStrategy();
Returns  
Number The current git_submodule_update_t value that will be used
for this submodule.  

Submodule#url Sync

var string = submodule.url();
Returns  
String  

Submodule#wdId Sync

var oid = submodule.wdId();
Returns  
Oid  

Submodule.IGNORE ENUM

Flag Value
Submodule.IGNORE.UNSPECIFIED -1
Submodule.IGNORE.NONE 1
Submodule.IGNORE.UNTRACKED 2
Submodule.IGNORE.DIRTY 3
Submodule.IGNORE.ALL 4

Submodule.RECURSE ENUM

Flag Value
Submodule.RECURSE.NO 0
Submodule.RECURSE.YES 1
Submodule.RECURSE.ONDEMAND 2

Submodule.STATUS ENUM

Flag Value
Submodule.STATUS.IN_HEAD 1
Submodule.STATUS.IN_INDEX 2
Submodule.STATUS.IN_CONFIG 4
Submodule.STATUS.IN_WD 8
Submodule.STATUS.INDEX_ADDED 16
Submodule.STATUS.INDEX_DELETED 32
Submodule.STATUS.INDEX_MODIFIED 64
Submodule.STATUS.WD_UNINITIALIZED 128
Submodule.STATUS.WD_ADDED 256
Submodule.STATUS.WD_DELETED 512
Submodule.STATUS.WD_MODIFIED 1024
Submodule.STATUS.WD_INDEX_MODIFIED 2048
Submodule.STATUS.WD_WD_MODIFIED 4096
Submodule.STATUS.WD_UNTRACKED 8192

Submodule.UPDATE ENUM

Flag Value
Submodule.UPDATE.CHECKOUT 1
Submodule.UPDATE.REBASE 2
Submodule.UPDATE.MERGE 3
Submodule.UPDATE.NONE 4
Submodule.UPDATE.DEFAULT 0