Fork me on GitHub
nodegit by tbranyen & faceleg

TreeEntry

new TreeEntry(rawRepo, rawTreeEntry)

Convenience tree entry constructor.
Parameters:
Name Type Description
rawRepo git.raw.Repo Raw repository object.
rawTreeEntry git.raw.TreeEntry Raw tree entry object.
Source:

Members

<readonly> fileModes :Integer

Refer to vendor/libgit2/include/git2/types.h for filemode definitions.
Properties:
Name Type Default Description
GIT_FILEMODE_NEW Integer git.raw.TreeEntry.fileModes.GIT_FILEMODE_NEW 0 (0000000)
GIT_FILEMODE_TREE Integer git.raw.TreeEntry.fileModes.GIT_FILEMODE_TREE 16384 (0040000)
GIT_FILEMODE_BLOB Integer git.raw.TreeEntry.fileModes.GIT_FILEMODE_BLOB 33188 (0100644)
GIT_FILEMODE_BLOB_EXECUTABLE Integer git.raw.TreeEntry.fileModes.GIT_FILEMODE_BLOB_EXECUTABLE 33261 (0100755)
GIT_FILEMODE_LINK Integer git.raw.TreeEntry.fileModes.GIT_FILEMODE_LINK 40960 (0120000)
GIT_FILEMODE_COMMIT Integer git.raw.TreeEntry.fileModes.GIT_FILEMODE_COMMIT 57344 (0160000)
Source:

Methods

content(callback)

Retrieve the TreeEntry's content.
Parameters:
Name Type Description
callback TreeEntry~contentCallback
Source:

isDirectory(callback)

Determine whether this Tree Entry is a directory.
Parameters:
Name Type Description
callback TreeEntry~isDirectoryCallback
Source:

isFile(callback)

Determine whether this TreeEntry is a file (blob or blob executable).
Parameters:
Name Type Description
callback TreeEntry~isFileCallback
Source:

name(callback)

Retrieve the name for this TreeEntry.
Parameters:
Name Type Description
callback TreeEntry~nameCallback
Source:

oid(callback)

Retrieve the Oid for this TreeEntry.
Parameters:
Name Type Description
callback TreeEntry~oidCallback
Source:

path(callback)

Retrieve the path relative to the repository root for this TreeEntry.
Parameters:
Name Type Description
callback TreeEntry~pathCallback
Source:

root(callback)

Retrieve the entry's root path.
Parameters:
Name Type Description
callback TreeEntry~rootCallback
Source:

sha(callback)

Retrieve the SHA for this TreeEntry.
Parameters:
Name Type Description
callback TreeEntry~shaCallback
Source:

toBlob(callback)

Convert the TreeEntry to a blob.
Parameters:
Name Type Description
callback TreeEntry~blobCallback
Source:

tree(callback)

Retrieve the TreeEntry's Tree.
Parameters:
Name Type Description
callback TreeEntry~treeCallback
Source:

Type Definitions

blobCallback(error, blob)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
blob Blob | null the blob representation of the entry.
Source:

contentCallback(error, content)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
content String | null the entry's content.
Source:

isDirectoryCallback(error, content)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
content Boolean | null True if the entry is a directory, false otherwise.
Source:

isFileCallback(error, content)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
content Boolean | null True if the entry is a blob or blob executable, false otherwise.
Source:

nameCallback(error, name)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
name String | null the entry's name.
Source:

oidCallback(error, oid)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
oid TreeEntry | null The Oid object or null.
Source:

pathCallback(error, path)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
path String | null the entry's full path relative to repository.
Source:

rootCallback(error, root)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
root String | null the entry's root path, relative to repository.
Source:

shaCallback(error, sha)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
sha String | null The SHA object or null.
Source:

treeCallback(error, tree)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
tree Tree | null the entry's tree.
Source: