Ggit.TreeBuilder

g GObject.Object GObject.Object Ggit.ObjectFactoryBase Ggit.ObjectFactoryBase GObject.Object->Ggit.ObjectFactoryBase Ggit.Native Ggit.Native Ggit.TreeBuilder Ggit.TreeBuilder Ggit.Native->Ggit.TreeBuilder Ggit.ObjectFactoryBase->Ggit.Native

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

clear ()

get_entry (path)

insert (filename, oid, file_mode)

remove (path)

write ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Ggit.Native (1)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Ggit.Native

r

Class Details

class Ggit.TreeBuilder(**kwargs)
Bases:

Ggit.Native

Abstract:

No

Structure:

Ggit.TreeBuilderClass

Represents a tree object.

clear()

Clear all entries in the tree builder.

get_entry(path)
Parameters:

path (str) – the path to remove.

Returns:

the #GGitTreeEntry or None if no such entry exists.

Return type:

Ggit.TreeEntry or None

Get an entry by path.

insert(filename, oid, file_mode)
Parameters:
Raises:

GLib.Error

Returns:

a Ggit.TreeEntry or None.

Return type:

Ggit.TreeEntry or None

Insert a file with a given blob in the tree builder. If the tree builder already contains an entry for the given file, then this entry will be overwritten.

Note that the returned Ggit.TreeEntry is bound to the lifetime of the tree builder and cannot be used after the tree builder has been freed.

remove(path)
Parameters:

path (str) – the path to remove.

Raises:

GLib.Error

Remove an entry from the builder by path.

write()
Raises:

GLib.Error

Returns:

the Ggit.OId of the created tree object or None.

Return type:

Ggit.OId or None

Write the contents of the tree builder as a tree object.