Git.framework Reference Library

GITPackCollection Class Reference

GITPackCollection Class Reference

Declared in GITPackCollection.h

Overview

This class implements a proxy for unpacking objects from a collection of GITPackFile instances.

A git repository might contain a number of PACK files, each of these are independent of each other and contain different sets of data. To aid extraction of objects from the collection of PACK files this class provides a means to iterate over the collection to find objects.

The collection also keeps track of which GITPackFile it last successfully extracted an object from, this is because linked objects are likely to be stored within the same PACK file.

Tasks

Class Methods

collectionWithContentsOfDirectory:error:

+ (GITPackCollection *)collectionWithContentsOfDirectory:(NSString *)directory error:(NSError **)error
Parameters
directory

The path to the directory to collect the pack files from

error

NSError describing any errors which occurred

Return Value

a collection with the pack files from the directory

Discussion

Creates and returns a new collection with the pack files in the directory.

See Also
Declared In
GITPackCollection.h

collectionWithPackFiles:

+ (GITPackCollection *)collectionWithPackFiles:(NSArray *)files
Parameters
files

Array of GITPackFile objects

Return Value

new collection

Discussion

Creates and returns a new collection from the array of files.

See Also
Declared In
GITPackCollection.h

Instance Methods

initWithPackFilesInDirectory:error:

- (id)initWithPackFilesInDirectory:(NSString *)directory error:(NSError **)error
Parameters
directory

The path to the directory to collect the pack files from

error

NSError describing any errors which occurred

Return Value

a collection with the pack files from the directory

Discussion

Creates and returns a new collection with the pack files in the directory.

See Also
Declared In
GITPackCollection.h

initWithPackFiles:

- (id)initWithPackFiles:(NSArray *)files
Parameters
files

Array of GITPackFile objects

Return Value

new collection

Discussion

Creates and returns a new collection from the array of files.

See Also
Declared In
GITPackCollection.h

unpackObjectWithSha1:error:

- (GITPackObject *)unpackObjectWithSha1:(GITObjectHash *)objectHash error:(NSError **)error
Parameters
objectHash

Hash identifying the object data to retrieve

error

NSError describing the error which occurred

Return Value

pack object for the specified objectHash or nil if not found

Discussion

Returns the first pack object found in the collection with the objectHash.

If this method returns nil then it means that the object could not be found in the collection, if there is an error then the error will not be nil.

Declared In
GITPackCollection.h

Last updated: 2011-2-20