Skip to content

Latest commit

 

History

History
478 lines (368 loc) · 14.7 KB

File metadata and controls

478 lines (368 loc) · 14.7 KB
layout default
menu_item api
title Submodule
description Version 0.5.0
return_to
API Documentation Index
/api/
sections
addSetup lookup resolveUrl setBranch setFetchRecurseSubmodules setIgnore setUpdate setUrl updateInitOptions #addFinalize #addToIndex #branch #fetchRecurseSubmodules #free #headId #ignore #indexId #init #name #open #owner #path #reload #repoInit #sync #update #updateStrategy #url #wdId IGNORE RECURSE STATUS UPDATE
#addSetup
#lookup
#resolveUrl
#setBranch
#setFetchRecurseSubmodules
#setIgnore
#setUpdate
#setUrl
#updateInitOptions
#addFinalize
#addToIndex
#branch
#fetchRecurseSubmodules
#free
#headId
#ignore
#indexId
#init
#name
#open
#owner
#path
#reload
#repoInit
#sync
#update
#updateStrategy
#url
#wdId
#IGNORE
#RECURSE
#STATUS
#UPDATE

Submodule.addSetup AsyncExperimental

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.lookup AsyncExperimental

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 AsyncExperimental

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 SyncExperimental

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 SyncExperimental

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 SyncExperimental

var result = Submodule.setIgnore(repo, name, ignore);
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 SyncExperimental

var result = Submodule.setUpdate(repo, name, update);
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 SyncExperimental

var result = Submodule.setUrl(repo, name, url);
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.updateInitOptions SyncExperimental

var result = Submodule.updateInitOptions(opts, version);
Parameters Type
opts SubmoduleUpdateOptions The git_submodule_update_options instance to initialize.
version Number Version of struct; pass GIT_SUBMODULE_UPDATE_OPTIONS_VERSION
Returns
Number Zero on success; -1 on failure.

Submodule#addFinalize SyncExperimental

var result = submodule.addFinalize();
Returns
Number

Submodule#addToIndex SyncExperimental

var result = submodule.addToIndex(write_index);

| 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 SyncExperimental

var string = submodule.branch();
Returns
String

Submodule#fetchRecurseSubmodules SyncExperimental

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

Submodule#free SyncExperimental

submodule.free();

Submodule#headId SyncExperimental

var oid = submodule.headId();
Returns
Oid

Submodule#ignore SyncExperimental

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

Submodule#indexId SyncExperimental

var oid = submodule.indexId();
Returns
Oid

Submodule#init SyncExperimental

var result = submodule.init(overwrite);

| 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#name SyncExperimental

var string = submodule.name();
Returns
String

Submodule#open SyncExperimental

var result = submodule.open(repo);

| Parameters | Type | | --- | --- | --- | | repo | Repository | Pointer to the submodule repo which was opened |

Returns
Number 0 on success,
<
0 if submodule repo could not be opened.

Submodule#owner SyncExperimental

var repository = submodule.owner();
Returns
Repository

Submodule#path SyncExperimental

var string = submodule.path();
Returns
String

Submodule#reload SyncExperimental

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 AsyncExperimental

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 SyncExperimental

var result = submodule.sync();
Returns
Number

Submodule#update SyncExperimental

var result = submodule.update(init, options);

| Parameters | Type | | --- | --- | --- | | init | Number | If the submodule is not initialized, setting this flag to true will initialize the submodule before updating. Otherwise, this will return an error if attempting to update an uninitialzed repository. but setting this to true forces them to be updated. | | options | SubmoduleUpdateOptions | configuration options for the update. If NULL, the function works as though GIT_SUBMODULE_UPDATE_OPTIONS_INIT was passed. |

Returns
Number 0 on success, any non-zero return value from a callback
     function, or a negative value to indicate an error (use
     `giterr_last` for a detailed error message). |

Submodule#updateStrategy SyncExperimental

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

Submodule#url SyncExperimental

var string = submodule.url();
Returns
String

Submodule#wdId SyncExperimental

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 |