Skip to content

Latest commit

 

History

History
220 lines (170 loc) · 5.89 KB

File metadata and controls

220 lines (170 loc) · 5.89 KB
layout menu_item title description return_to sections
default
api
Object
Version 0.26.1
API Documentation Index
/api/
lookup lookupPrefix size string2Type type2String typeisloose #dup #id #lookupByPath #owner #peel #shortId #type TYPE
#lookup
#lookupPrefix
#size
#string2Type
#type2String
#typeisloose
#dup
#id
#lookupByPath
#owner
#peel
#shortId
#type
#TYPE

Object.lookup AsyncExperimental

Object.lookup(repo, id, type).then(function(object) {
  // Use object
});
Parameters Type
repo Repository the repository to look up the object
id Oid the unique identifier for the object
type Number the type of the object
Returns
Object

Object.lookupPrefix AsyncExperimental

Object.lookupPrefix(repo, id, len, type).then(function(object) {
  // Use object
});
Parameters Type
repo Repository the repository to look up the object
id Oid a short identifier for the object
len Number the length of the short identifier
type Number the type of the object
Returns
Object the looked-up object

Object.size SyncExperimental

var result = Object.size(type);
Parameters Type
type Number object type to get its size
Returns
Number size in bytes of the object

Object.string2Type SyncExperimental

var result = Object.string2Type(str);
Parameters Type
str String the string to convert.
Returns
Number the corresponding git_object_t.

Object.type2String SyncExperimental

var string = Object.type2String(type);
Parameters Type
type Number object type to convert.
Returns
String the corresponding string representation.

Object.typeisloose SyncExperimental

var result = Object.typeisloose(type);
Parameters Type
type Number object type to test.
Returns
Number true if the type represents a valid loose object type,
false otherwise.

Object#dup AsyncExperimental

object.dup().then(function(object) {
  // Use object
});
Returns
Object

Object#id SyncExperimental

var oid = object.id();
Returns
Oid the SHA1 id

Object#lookupByPath AsyncExperimental

object.lookupByPath(path, type).then(function(object) {
  // Use object
});

| Parameters | Type | | --- | --- | --- | | path | String | relative path from the root object to the desired object | | type | Number | type of object desired |

Returns
Object buffer that receives the object (which must be freed
        by the caller) |

Object#owner SyncExperimental

var repository = object.owner();
Returns
Repository the repository who owns this object

Object#peel AsyncExperimental

object.peel(target_type).then(function(object) {
  // Use object
});

| Parameters | Type | | --- | --- | --- | | target_type | Number | The type of the requested object (a GIT_OBJECT_ value) |

Returns
Object

Object#shortId AsyncExperimental

object.shortId().then(function(buf) {
  // Use buf
});
Returns
Buf Buffer to write string into

Object#type SyncExperimental

var result = object.type();
Returns
Number the object's type

Object.TYPE ENUM

| Flag | Value | | --- | --- | --- | | Object.TYPE.ANY | -2 | | Object.TYPE.INVALID | -1 | | Object.TYPE.COMMIT | 1 | | Object.TYPE.TREE | 2 | | Object.TYPE.BLOB | 3 | | Object.TYPE.TAG | 4 | | Object.TYPE.OFS_DELTA | 6 | | Object.TYPE.REF_DELTA | 7 |