Git.framework Reference Library

GITTree Class Reference

GITTree Class Reference

Inherits from
Conforms to
Declared in GITTree.h

Overview

This class represents Tree objects in a git repository.

Tree objects store the file system structure of a repository at the point at which the tree is created. They represent directories or folders and contain references to items in the directory/folder which may be other trees, directory/folder, or blobs, files.

Tree objects store a list of directory items with their associated modes and SHA1 references. The SHA1 references are in the packed form. * 100644 .gitignore a5cc2925ca8258af241be7e5b0381edf30266302 * 100644 README 69e27356ef629022720d868ab0c0e3394775b6c1 *

Tasks

Properties

items

The items in the tree.

@property NSArray *items
Declared In
GITTree.h

Class Methods

treeFromData:sha1:repo:error:

+ (GITTree *)treeFromData:(NSData *)data sha1:(GITObjectHash *)objectHash repo:(GITRepo *)repo error:(NSError **)error
Parameters
data

The data to create the tree from

objectHash

The SHA1 hash of the receiver

repo

The repository the tree is a member of

error

NSError describing any errors which occurred

Return Value

A tree object

Discussion

Creates and returns a tree from the data.

The data is parsed to extract the references to the tree contents, the contents are then stored in the items array as GITTreeItem objects.

Declared In
GITTree.h

Instance Methods

containsObject:

- (BOOL)containsObject:(id)anObject
Parameters
anObject

An object

Return Value

YES if anObject is present in the tree, otherwise NO.

Discussion

Returns a Boolean value that indicates whether a given object is present in the tree.

This method determines whether anObject is present in the array by sending an isEqual: message to each of the array’s objects (and passing anObject as the parameter to each isEqual: message).

Declared In
GITTree.h

Last updated: 2011-2-20