Hash :
02b1083a
Author :
Date :
2018-01-28T23:25:07
apply: introduce `git_apply_tree` Introduce `git_apply_tree`, which will apply a `git_diff` to a given `git_tree`, allowing an in-memory patch application for a repository.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_git_apply_h__
#define INCLUDE_git_apply_h__
#include "common.h"
#include "types.h"
#include "oid.h"
#include "diff.h"
/**
* @file git2/apply.h
* @brief Git patch application routines
* @defgroup git_apply Git patch application routines
* @ingroup Git
* @{
*/
GIT_BEGIN_DECL
/**
* Apply a `git_diff` to a `git_tree`, and return the resulting image
* as an index.
*
* @param out the postimage of the application
* @param repo the repository to apply
* @param preimage the tree to apply the diff to
* @param diff the diff to apply
*/
GIT_EXTERN(int) git_apply_to_tree(
git_index **out,
git_repository *repo,
git_tree *preimage,
git_diff *diff);
/** @} */
GIT_END_DECL
#endif