Git.framework Reference Library

GITPackObject Class Reference

GITPackObject Class Reference

Declared in GITPackObject.h

Overview

The GITPackObject class aids in the extraction of objects from PACK files.

The class combines the data of the object and the indicated type for later conversion into a normal git object type such as commit, tree, blob or tag.

When loading an object from a PACK file you do not create instances of this class directly, rather you call the -unpackObjectWithSha1:error: method on the GITPackFile and an instance of this class is returned.

Tasks

Properties

type

Type of the object the data represents.

@property GITObjectType type
Declared In
GITPackObject.h

data

Data of the packed object.

@property NSData *data
Declared In
GITPackObject.h

sha1

SHA1 Hash of the packed object.

@property GITObjectHash *sha1
Declared In
GITPackObject.h

length

size of the receivers data

@property NSUInteger length
Declared In
GITPackObject.h

Class Methods

packObjectWithData:sha1:type:

+ (GITPackObject *)packObjectWithData:(NSData *)packData sha1:(GITObjectHash *)objectHash type:(GITObjectType)objectType
Parameters
packData

Data to create the PACK object from

objectHash

The SHA1 hash of the object

objectType

Type of object the packData represents

Return Value

new pack object

Discussion

Create and return a new PACK object.

See Also
Declared In
GITPackObject.h

Instance Methods

initWithData:sha1:type:

- (id)initWithData:(NSData *)packData sha1:(GITObjectHash *)objectHash type:(GITObjectType)objectType
Parameters
packData

Data of the object

objectHash

The SHA1 hash of the object

objectType

Type of the object the packData represents

Return Value

new pack object

Discussion

Create and return a new PACK object.

See Also
Declared In
GITPackObject.h

objectInRepo:error:

- (GITObject *)objectInRepo:(GITRepo *)repo error:(NSError **)error
Parameters
repo

Repository the object should belong to

error

NSError describing any errors which occurred

Return Value

object in the repo

Discussion

Returns the object contained in the receiver and sets the repo of the object.

See Also
Declared In
GITPackObject.h

packObjectByDeltaPatchingWithData:

- (GITPackObject *)packObjectByDeltaPatchingWithData:(NSData *)deltaData
Parameters
deltaData

Data to patch the receivers data with

Return Value

new PACK object with the result of patching the receivers data with deltaData

Discussion

Returns a new PACK object by patching the receivers data with deltaData.

Declared In
GITPackObject.h

Last updated: 2011-2-20