Module Blob

Class "Blob". Extends Object

Functions

Blob.frombuffer (repo, buffer) module function.
Blob.fromfile (repo, path) module function.
Blob.lookup (repo, id) Create a new Blob object.
Blob:rawcontent () object method.
Blob:rawsize () object method.
Object:free () Destroy this object (will be called by Garbage Collector).
Object:id () object method.
Object:owner () object method.
Object:type () object method.


Functions

Blob.frombuffer (repo, buffer)
module function.

Calls git_blob_create_frombuffer:

Parameters

  • repo: repository where to blob will be written. Must be of type Repository.
  • buffer: data to be written into the blob. Must be of type string.

Return values:

  1. OID or nil on error.
  2. Error string.
Blob.fromfile (repo, path)
module function.

Calls git_blob_create_fromfile:

Parameters

  • repo: repository where the blob will be written. this repository cannot be bare. Must be of type Repository.
  • path: file from which the blob will be created, relative to the repository's working dir. Must be of type string.

Return values:

  1. OID or nil on error.
  2. Error string.
Blob.lookup (repo, id)
Create a new Blob object.

Calls git_blob_lookup:

Parameters

  • repo: the repo to use when locating the blob.. Must be of type Repository.
  • id: identity of the blob to locate.. Must be of type OID.

Return values:

  1. Blob or nil on error.
  2. Error string.
Blob:rawcontent ()
object method.

Calls git_blob_rawcontent:

A pointer to the raw content of a blob is returned; this pointer is owned internally by the object and shall not be free'd. The pointer may be invalidated at a later time.

Calls git_blob_rawsize:

Return value:

string.
Blob:rawsize ()
object method.

Calls git_blob_rawsize:

Return value:

integer.
Object:free ()
Destroy this object (will be called by Garbage Collector).

Calls git_object_free:

This method instructs the library to close an existing object; note that git_objects are owned and cached by the repository so the object may or may not be freed after this library call, depending on how agressive is the caching mechanism used by the repository.

IMPORTANT: It *is* necessary to call this method when you stop using an object. Failure to do so will cause a memory leak.

Object:id ()
object method.

Calls git_object_id:

Return value:

OID.
Object:owner ()
object method.

Calls git_object_owner:

Freeing or calling `git_repository_close` on the returned pointer will invalidate the actual object.

Any other operation may be run on the repository without affecting the object.

Return value:

Repository.
Object:type ()
object method.

Calls git_object_type:

Return value:

string.

Valid XHTML 1.0!