3. Blob¶
Contents
3.1. blob_create_fromdisk¶
parameters | Returns |
---|---|
luagit2_repository | luagit2_oid |
path_to_blob(string) |
luagit2_repository
: The repository to look into for the given blob.path_to_blob
: the path to the blob in repository .
Note
The path should be relative to current path, which may or may not inside the directory.
- Creates a
luagit2_oid
from blob’s path. - libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_create_fromdisk
3.2. blob_create_fromworkdir¶
parameters | Returns |
---|---|
luagit2_repository | luagit2_oid |
path_to_blob(string) |
luagit2_repository
: The repository to look into for the given blob.path_to_blob
: the path to the blob in repository.
Note
The path should be relative to root directory of repository. Prefer this method over blob_create_fromdisk while creating blob using its path and not oid.
- Creates a
luagit2_oid
from blob’s path. - libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_create_fromdisk
3.3. blob_filtered_content¶
parameters | Returns |
---|---|
luagit2_blob | luagit2_buf |
path_to_blob(string) | |
check_for_binary_data(int) |
luagit2_blob
: The luagit2_blob whose content to look for .path_to_blob
: the path to the blob in repository.check_for_binary_data
: integer value of bool whether to check or not for filtered content.
Note
The path should be relative to root directory of repository.
- Creates a
luagit2_buf
from blob’s Content, can be read using buf_details(). - libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_filtered_content
3.4. blob_id¶
parameters | Returns |
---|---|
luagit2_blob | luagit2_oid |
luagit2_blob
: The blob whose oid is to be found.
- Creates a
luagit2_oid
for given blob. - libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_id
3.5. blob_is_binary¶
parameters | Returns |
---|---|
luagit2_blob | boolean |
luagit2_blob
: The blob which is to be checked.
- returns boolean if blob is binary or not.
- libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_is_binary
3.6. blob_lookup¶
parameters | Returns |
---|---|
luagit2_repository | luagit2_blob |
luagit2_oid |
luagit2_repository
: The repository to look into for the given blob.luagit2_oid
: the oid of the blob to look for.
- returns
luagit2_blob
for given oid or an error. - libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_lookup
3.7. blob_lookup_prefix¶
parameters | Returns |
---|---|
luagit2_repository | luagit2_blob |
luagit2_oid | |
length (int) |
luagit2_repository
: The repository to look into for the given blob.luagit2_oid
: the oid of the blob to look for.length
: length of oid to use for looking up.
- returns
luagit2_blob
for given oid or an error. - libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_lookup_prefix
3.8. blob_owner¶
parameters | Returns |
---|---|
luagit2_blob | luagit2_repository |
luagit2_blob
: The blob whose owner repo is to be found.
- returns
luagit2_repository
or gives an error. - libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_owner
3.9. blob_rawsize¶
parameters | Returns |
---|---|
luagit2_blob | size(number) |
luagit2_blob
: The blob whose content size is to be found.
- returns a numerical value of the blob’s size or gives an error.
- libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_rawsize
3.10. blob_free¶
parameters | Returns |
---|---|
luagit2_blob | None |
luagit2_blob
: The blob which is to be freed.
- returns None or gives an error.
- libgit2 equivalent : https://libgit2.org/libgit2/#v0.27.0/group/blob/git_blob_free