GgitTreeBuilder: libgit2-glib Reference Manual

## GgitTreeBuilder GgitTreeBuilder |

## Functions

void | ggit_tree_builder_remove ()
void | ggit_tree_builder_clear ()
GgitTreeEntry * | ggit_tree_builder_insert ()
GgitOId * | ggit_tree_builder_write ()
GgitTreeEntry * | ggit_tree_builder_get_entry ()

## Types and Values

| GgitTreeBuilder
struct | GgitTreeBuilderClass

## Object Hierarchy

        GObject
        ╰── GgitObjectFactoryBase
            ╰── GgitNative
                ╰── GgitTreeBuilder

## Description

## Functions

### ggit_tree_builder_remove ()

    void
    ggit_tree_builder_remove (GgitTreeBuilder *builder,
                              const gchar *path,
                              GError **error);

Remove an entry from the builder by path.

#### Parameters

builder | a GgitTreeBuilder. |
path | the path to remove. |
error | a GError for error reporting, or `NULL`. |

### ggit_tree_builder_clear ()

    void
    ggit_tree_builder_clear (GgitTreeBuilder *builder);

Clear all entries in the tree builder.

#### Parameters

builder | a GgitTreeBuilder. |

### ggit_tree_builder_insert ()

    GgitTreeEntry *
    ggit_tree_builder_insert (GgitTreeBuilder *builder,
                              const gchar *filename,
                              GgitOId *oid,
                              GgitFileMode file_mode,
                              GError **error);

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 GgitTreeEntry is bound to the lifetime of the tree builder and cannot be used after the tree builder has been freed.

#### Parameters

builder | a GgitTreeBuilder. |
filename | the file name. |
oid | the GgitOId of the file blob to insert. |
file_mode | a GgitFileMode. |
error | a GError for error reporting, or `NULL`. |

#### Returns

a GgitTreeEntry.

[transfer full]

### ggit_tree_builder_write ()

    GgitOId *
    ggit_tree_builder_write (GgitTreeBuilder *builder,
                             GError **error);

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

#### Parameters

builder | a GgitTreeBuilder. |
error | a GError for error reporting, or `NULL`. |

#### Returns

the GgitOId of the created tree object.

### ggit_tree_builder_get_entry ()

    GgitTreeEntry *
    ggit_tree_builder_get_entry (GgitTreeBuilder *builder,
                                 const gchar *path);

Get an entry by path.

#### Parameters

builder | a GgitTreeBuilder. |
path | the path to remove. |

#### Returns

the GGitTreeEntry or `NULL` if no such entry exists.

## Types and Values

### GgitTreeBuilder

    typedef struct _GgitTreeBuilder GgitTreeBuilder;

Represents a tree object.

### struct GgitTreeBuilderClass

    struct GgitTreeBuilderClass {
    };

The class structure for GgitTreeBuilderClass.

#### Members