Ggit.Diff.new_tree_to_index
Description: Reference for Ggit.Diff.new_tree_to_index

### Constructor

# Ggit Diffnew_tree_to_index

#### Declaration [src]

    GgitDiff*
    ggit_diff_new_tree_to_index (
      GgitRepository* repository,
      GgitTree* old_tree,
      GgitIndex* index,
      GgitDiffOptions* diff_options,
      GError** error
    )

#### Description [src]

Creates a `GgitDiff` which compares `old_tree` and the index.

If `index` is `NULL` then `repository` index is used. If `diff_options` is `NULL` then the defaults specified in `ggit_diff_options_new()` are used.

#### Parameters

`repository` | `GgitRepository`
| A `GgitRepository`.
| The data is owned by the caller of the function.
`old_tree` | `GgitTree`
| A `GgitTree` to diff from.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`index` | `GgitIndex`
| A `GgitIndex`, or `NULL`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`diff_options` | `GgitDiffOptions`
| A `GgitDiffOptions`, or `NULL`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`error` | `GError **`
| The return location for a `GError*`, or `NULL`.

#### Return value

Returns: | `GgitDiff`
| A newly allocated `GgitDiff` if there was no error, `NULL` otherwise.
| The caller of the function takes ownership of the data, and is responsible for freeing it.
| The return value can be `NULL`.