Module gall.object
Generic object interface
Functions
create (repo, type, content) | Create a new raw object. |
new (repo, sha) | Create a new raw object. |
Class object
object.content | The object’s processed content. |
object.raw | The object’s raw content |
object.sha | The object’s OID (SHA1) |
object.size | The size of the object |
object.type | The type of the object |
Functions
- create (repo, type, content)
-
Create a new raw object.
Create a new raw object and insert it into the given repository. This will not only create the object instance but also insert it into the repository storage.
Parameters:
- repo repository The repository within which the object resides.
- type string The type of the object (e.g. blob or commit)
- content string The content to insert as the object’s content.
Returns:
-
object
The object instance encapsulating the given object.
Or
- nil Nil on error
- string The error message
- new (repo, sha)
-
Create a new raw object.
Create a new instance of object referring to the given SHA1 OID.
Parameters:
- repo repository The repository within which the object resides.
- sha string The SHA1 OID of the object in the repository.
Returns:
-
object
The object instance encapsulating the given object.
Class object
Low level git object- object.content
-
The object’s processed content.
- If the object is a commit, then this will be a commit instance.
- If the object is a tree, then this will be a tree instance.
- If the object is a tag, then this will be a tag instance.
- content
- object.raw
-
The object’s raw content
- raw
- object.sha
-
The object’s OID (SHA1)
- sha
- object.size
-
The size of the object
- size
- object.type
-
The type of the object
- type