Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/imh-pyth.../include/git2
File: apply.h
/*
[0] Fix | Delete
* Copyright (C) the libgit2 contributors. All rights reserved.
[1] Fix | Delete
*
[2] Fix | Delete
* This file is part of libgit2, distributed under the GNU GPL v2 with
[3] Fix | Delete
* a Linking Exception. For full terms see the included COPYING file.
[4] Fix | Delete
*/
[5] Fix | Delete
#ifndef INCLUDE_git_apply_h__
[6] Fix | Delete
#define INCLUDE_git_apply_h__
[7] Fix | Delete
[8] Fix | Delete
#include "common.h"
[9] Fix | Delete
#include "types.h"
[10] Fix | Delete
#include "oid.h"
[11] Fix | Delete
#include "diff.h"
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* @file git2/apply.h
[15] Fix | Delete
* @brief Git patch application routines
[16] Fix | Delete
* @defgroup git_apply Git patch application routines
[17] Fix | Delete
* @ingroup Git
[18] Fix | Delete
* @{
[19] Fix | Delete
*/
[20] Fix | Delete
GIT_BEGIN_DECL
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* When applying a patch, callback that will be made per delta (file).
[24] Fix | Delete
*
[25] Fix | Delete
* When the callback:
[26] Fix | Delete
* - returns < 0, the apply process will be aborted.
[27] Fix | Delete
* - returns > 0, the delta will not be applied, but the apply process
[28] Fix | Delete
* continues
[29] Fix | Delete
* - returns 0, the delta is applied, and the apply process continues.
[30] Fix | Delete
*
[31] Fix | Delete
* @param delta The delta to be applied
[32] Fix | Delete
* @param payload User-specified payload
[33] Fix | Delete
*/
[34] Fix | Delete
typedef int GIT_CALLBACK(git_apply_delta_cb)(
[35] Fix | Delete
const git_diff_delta *delta,
[36] Fix | Delete
void *payload);
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* When applying a patch, callback that will be made per hunk.
[40] Fix | Delete
*
[41] Fix | Delete
* When the callback:
[42] Fix | Delete
* - returns < 0, the apply process will be aborted.
[43] Fix | Delete
* - returns > 0, the hunk will not be applied, but the apply process
[44] Fix | Delete
* continues
[45] Fix | Delete
* - returns 0, the hunk is applied, and the apply process continues.
[46] Fix | Delete
*
[47] Fix | Delete
* @param hunk The hunk to be applied
[48] Fix | Delete
* @param payload User-specified payload
[49] Fix | Delete
*/
[50] Fix | Delete
typedef int GIT_CALLBACK(git_apply_hunk_cb)(
[51] Fix | Delete
const git_diff_hunk *hunk,
[52] Fix | Delete
void *payload);
[53] Fix | Delete
[54] Fix | Delete
/** Flags controlling the behavior of git_apply */
[55] Fix | Delete
typedef enum {
[56] Fix | Delete
/**
[57] Fix | Delete
* Don't actually make changes, just test that the patch applies.
[58] Fix | Delete
* This is the equivalent of `git apply --check`.
[59] Fix | Delete
*/
[60] Fix | Delete
GIT_APPLY_CHECK = (1 << 0),
[61] Fix | Delete
} git_apply_flags_t;
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* Apply options structure
[65] Fix | Delete
*
[66] Fix | Delete
* Initialize with `GIT_APPLY_OPTIONS_INIT`. Alternatively, you can
[67] Fix | Delete
* use `git_apply_options_init`.
[68] Fix | Delete
*
[69] Fix | Delete
* @see git_apply_to_tree, git_apply
[70] Fix | Delete
*/
[71] Fix | Delete
typedef struct {
[72] Fix | Delete
unsigned int version; /**< The version */
[73] Fix | Delete
[74] Fix | Delete
/** When applying a patch, callback that will be made per delta (file). */
[75] Fix | Delete
git_apply_delta_cb delta_cb;
[76] Fix | Delete
[77] Fix | Delete
/** When applying a patch, callback that will be made per hunk. */
[78] Fix | Delete
git_apply_hunk_cb hunk_cb;
[79] Fix | Delete
[80] Fix | Delete
/** Payload passed to both delta_cb & hunk_cb. */
[81] Fix | Delete
void *payload;
[82] Fix | Delete
[83] Fix | Delete
/** Bitmask of git_apply_flags_t */
[84] Fix | Delete
unsigned int flags;
[85] Fix | Delete
} git_apply_options;
[86] Fix | Delete
[87] Fix | Delete
#define GIT_APPLY_OPTIONS_VERSION 1
[88] Fix | Delete
#define GIT_APPLY_OPTIONS_INIT {GIT_APPLY_OPTIONS_VERSION}
[89] Fix | Delete
[90] Fix | Delete
GIT_EXTERN(int) git_apply_options_init(git_apply_options *opts, unsigned int version);
[91] Fix | Delete
[92] Fix | Delete
/**
[93] Fix | Delete
* Apply a `git_diff` to a `git_tree`, and return the resulting image
[94] Fix | Delete
* as an index.
[95] Fix | Delete
*
[96] Fix | Delete
* @param out the postimage of the application
[97] Fix | Delete
* @param repo the repository to apply
[98] Fix | Delete
* @param preimage the tree to apply the diff to
[99] Fix | Delete
* @param diff the diff to apply
[100] Fix | Delete
* @param options the options for the apply (or null for defaults)
[101] Fix | Delete
*/
[102] Fix | Delete
GIT_EXTERN(int) git_apply_to_tree(
[103] Fix | Delete
git_index **out,
[104] Fix | Delete
git_repository *repo,
[105] Fix | Delete
git_tree *preimage,
[106] Fix | Delete
git_diff *diff,
[107] Fix | Delete
const git_apply_options *options);
[108] Fix | Delete
[109] Fix | Delete
/** Possible application locations for git_apply */
[110] Fix | Delete
typedef enum {
[111] Fix | Delete
/**
[112] Fix | Delete
* Apply the patch to the workdir, leaving the index untouched.
[113] Fix | Delete
* This is the equivalent of `git apply` with no location argument.
[114] Fix | Delete
*/
[115] Fix | Delete
GIT_APPLY_LOCATION_WORKDIR = 0,
[116] Fix | Delete
[117] Fix | Delete
/**
[118] Fix | Delete
* Apply the patch to the index, leaving the working directory
[119] Fix | Delete
* untouched. This is the equivalent of `git apply --cached`.
[120] Fix | Delete
*/
[121] Fix | Delete
GIT_APPLY_LOCATION_INDEX = 1,
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* Apply the patch to both the working directory and the index.
[125] Fix | Delete
* This is the equivalent of `git apply --index`.
[126] Fix | Delete
*/
[127] Fix | Delete
GIT_APPLY_LOCATION_BOTH = 2,
[128] Fix | Delete
} git_apply_location_t;
[129] Fix | Delete
[130] Fix | Delete
/**
[131] Fix | Delete
* Apply a `git_diff` to the given repository, making changes directly
[132] Fix | Delete
* in the working directory, the index, or both.
[133] Fix | Delete
*
[134] Fix | Delete
* @param repo the repository to apply to
[135] Fix | Delete
* @param diff the diff to apply
[136] Fix | Delete
* @param location the location to apply (workdir, index or both)
[137] Fix | Delete
* @param options the options for the apply (or null for defaults)
[138] Fix | Delete
*/
[139] Fix | Delete
GIT_EXTERN(int) git_apply(
[140] Fix | Delete
git_repository *repo,
[141] Fix | Delete
git_diff *diff,
[142] Fix | Delete
git_apply_location_t location,
[143] Fix | Delete
const git_apply_options *options);
[144] Fix | Delete
[145] Fix | Delete
/** @} */
[146] Fix | Delete
GIT_END_DECL
[147] Fix | Delete
#endif
[148] Fix | Delete
[149] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function