Skip to content

Latest commit

 

History

History
153 lines (126 loc) · 5.04 KB

File metadata and controls

153 lines (126 loc) · 5.04 KB
layout default
menu_item api
title Status
description Version 0.19.0
return_to
API Documentation Index
/api/
sections
byIndex file foreach foreachExt shouldIgnore OPT SHOW STATUS
#byIndex
#file
#foreach
#foreachExt
#shouldIgnore
#OPT
#SHOW
#STATUS

Status.byIndex Sync

var statusEntry = Status.byIndex(statuslist, idx);
Parameters Type
statuslist StatusList Existing status list object
idx Number Position of the entry
Returns
StatusEntry

Status.file Sync

var result = Status.file(repo, path);
Parameters Type
repo Repository A repository object
path String The exact path to retrieve status for relative to the repository working directory
Returns
Number Output combination of git_status_t values for file

Status.foreach Async

Status.foreach(repo, callback, payload).then(function(result) {
  // Use result
});
Parameters Type
repo Repository A repository object
callback StatusCb The function to call on each file
payload Void Pointer to pass through to callback function
Returns
Number 0 on success, non-zero callback return value, or error code

Status.foreachExt Async

Status.foreachExt(repo, opts, callback, payload).then(function(result) {
  // Use result
});
Parameters Type
repo Repository Repository object
opts StatusOptions Status options structure
callback StatusCb The function to call on each file
payload Void Pointer to pass through to callback function
Returns
Number 0 on success, non-zero callback return value, or error code

Status.shouldIgnore Sync

var result = Status.shouldIgnore(ignored, repo, path);
Parameters Type
ignored Number Boolean returning 0 if the file is not ignored, 1 if it is
repo Repository A repository object
path String The file to check ignores for, rooted at the repo's workdir.
Returns
Number 0 if ignore rules could be processed for the file (regardless
     of whether it exists or not), or an error 

< 0 if they could not. |

Status.OPT ENUM

| Flag | Value | | --- | --- | --- | | Status.OPT.INCLUDE_UNTRACKED | 1 | | Status.OPT.INCLUDE_IGNORED | 2 | | Status.OPT.INCLUDE_UNMODIFIED | 4 | | Status.OPT.EXCLUDE_SUBMODULES | 8 | | Status.OPT.RECURSE_UNTRACKED_DIRS | 16 | | Status.OPT.DISABLE_PATHSPEC_MATCH | 32 | | Status.OPT.RECURSE_IGNORED_DIRS | 64 | | Status.OPT.RENAMES_HEAD_TO_INDEX | 128 | | Status.OPT.RENAMES_INDEX_TO_WORKDIR | 256 | | Status.OPT.SORT_CASE_SENSITIVELY | 512 | | Status.OPT.SORT_CASE_INSENSITIVELY | 1024 | | Status.OPT.RENAMES_FROM_REWRITES | 2048 | | Status.OPT.NO_REFRESH | 4096 | | Status.OPT.UPDATE_INDEX | 8192 | | Status.OPT.INCLUDE_UNREADABLE | 16384 | | Status.OPT.INCLUDE_UNREADABLE_AS_UNTRACKED | 32768 |

Status.SHOW ENUM

| Flag | Value | | --- | --- | --- | | Status.SHOW.INDEX_AND_WORKDIR | 0 | | Status.SHOW.INDEX_ONLY | 1 | | Status.SHOW.WORKDIR_ONLY | 2 |

Status.STATUS ENUM

| Flag | Value | | --- | --- | --- | | Status.STATUS.CURRENT | 0 | | Status.STATUS.INDEX_NEW | 1 | | Status.STATUS.INDEX_MODIFIED | 2 | | Status.STATUS.INDEX_DELETED | 4 | | Status.STATUS.INDEX_RENAMED | 8 | | Status.STATUS.INDEX_TYPECHANGE | 16 | | Status.STATUS.WT_NEW | 128 | | Status.STATUS.WT_MODIFIED | 256 | | Status.STATUS.WT_DELETED | 512 | | Status.STATUS.WT_TYPECHANGE | 1024 | | Status.STATUS.WT_RENAMED | 2048 | | Status.STATUS.WT_UNREADABLE | 4096 | | Status.STATUS.IGNORED | 16384 | | Status.STATUS.CONFLICTED | 32768 |