Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/imh-pyth.../include/git2
File: clone.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_clone_h__
[6] Fix | Delete
#define INCLUDE_git_clone_h__
[7] Fix | Delete
[8] Fix | Delete
#include "common.h"
[9] Fix | Delete
#include "types.h"
[10] Fix | Delete
#include "indexer.h"
[11] Fix | Delete
#include "checkout.h"
[12] Fix | Delete
#include "remote.h"
[13] Fix | Delete
#include "transport.h"
[14] Fix | Delete
[15] Fix | Delete
[16] Fix | Delete
/**
[17] Fix | Delete
* @file git2/clone.h
[18] Fix | Delete
* @brief Git cloning routines
[19] Fix | Delete
* @defgroup git_clone Git cloning routines
[20] Fix | Delete
* @ingroup Git
[21] Fix | Delete
* @{
[22] Fix | Delete
*/
[23] Fix | Delete
GIT_BEGIN_DECL
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* Options for bypassing the git-aware transport on clone. Bypassing
[27] Fix | Delete
* it means that instead of a fetch, libgit2 will copy the object
[28] Fix | Delete
* database directory instead of figuring out what it needs, which is
[29] Fix | Delete
* faster. If possible, it will hardlink the files to save space.
[30] Fix | Delete
*/
[31] Fix | Delete
typedef enum {
[32] Fix | Delete
/**
[33] Fix | Delete
* Auto-detect (default), libgit2 will bypass the git-aware
[34] Fix | Delete
* transport for local paths, but use a normal fetch for
[35] Fix | Delete
* `file://` urls.
[36] Fix | Delete
*/
[37] Fix | Delete
GIT_CLONE_LOCAL_AUTO,
[38] Fix | Delete
/**
[39] Fix | Delete
* Bypass the git-aware transport even for a `file://` url.
[40] Fix | Delete
*/
[41] Fix | Delete
GIT_CLONE_LOCAL,
[42] Fix | Delete
/**
[43] Fix | Delete
* Do no bypass the git-aware transport
[44] Fix | Delete
*/
[45] Fix | Delete
GIT_CLONE_NO_LOCAL,
[46] Fix | Delete
/**
[47] Fix | Delete
* Bypass the git-aware transport, but do not try to use
[48] Fix | Delete
* hardlinks.
[49] Fix | Delete
*/
[50] Fix | Delete
GIT_CLONE_LOCAL_NO_LINKS,
[51] Fix | Delete
} git_clone_local_t;
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* The signature of a function matching git_remote_create, with an additional
[55] Fix | Delete
* void* as a callback payload.
[56] Fix | Delete
*
[57] Fix | Delete
* Callers of git_clone may provide a function matching this signature to override
[58] Fix | Delete
* the remote creation and customization process during a clone operation.
[59] Fix | Delete
*
[60] Fix | Delete
* @param out the resulting remote
[61] Fix | Delete
* @param repo the repository in which to create the remote
[62] Fix | Delete
* @param name the remote's name
[63] Fix | Delete
* @param url the remote's url
[64] Fix | Delete
* @param payload an opaque payload
[65] Fix | Delete
* @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
[66] Fix | Delete
*/
[67] Fix | Delete
typedef int GIT_CALLBACK(git_remote_create_cb)(
[68] Fix | Delete
git_remote **out,
[69] Fix | Delete
git_repository *repo,
[70] Fix | Delete
const char *name,
[71] Fix | Delete
const char *url,
[72] Fix | Delete
void *payload);
[73] Fix | Delete
[74] Fix | Delete
/**
[75] Fix | Delete
* The signature of a function matchin git_repository_init, with an
[76] Fix | Delete
* aditional void * as callback payload.
[77] Fix | Delete
*
[78] Fix | Delete
* Callers of git_clone my provide a function matching this signature
[79] Fix | Delete
* to override the repository creation and customization process
[80] Fix | Delete
* during a clone operation.
[81] Fix | Delete
*
[82] Fix | Delete
* @param out the resulting repository
[83] Fix | Delete
* @param path path in which to create the repository
[84] Fix | Delete
* @param bare whether the repository is bare. This is the value from the clone options
[85] Fix | Delete
* @param payload payload specified by the options
[86] Fix | Delete
* @return 0, or a negative value to indicate error
[87] Fix | Delete
*/
[88] Fix | Delete
typedef int GIT_CALLBACK(git_repository_create_cb)(
[89] Fix | Delete
git_repository **out,
[90] Fix | Delete
const char *path,
[91] Fix | Delete
int bare,
[92] Fix | Delete
void *payload);
[93] Fix | Delete
[94] Fix | Delete
/**
[95] Fix | Delete
* Clone options structure
[96] Fix | Delete
*
[97] Fix | Delete
* Initialize with `GIT_CLONE_OPTIONS_INIT`. Alternatively, you can
[98] Fix | Delete
* use `git_clone_options_init`.
[99] Fix | Delete
*
[100] Fix | Delete
*/
[101] Fix | Delete
typedef struct git_clone_options {
[102] Fix | Delete
unsigned int version;
[103] Fix | Delete
[104] Fix | Delete
/**
[105] Fix | Delete
* These options are passed to the checkout step. To disable
[106] Fix | Delete
* checkout, set the `checkout_strategy` to
[107] Fix | Delete
* `GIT_CHECKOUT_NONE`.
[108] Fix | Delete
*/
[109] Fix | Delete
git_checkout_options checkout_opts;
[110] Fix | Delete
[111] Fix | Delete
/**
[112] Fix | Delete
* Options which control the fetch, including callbacks.
[113] Fix | Delete
*
[114] Fix | Delete
* The callbacks are used for reporting fetch progress, and for acquiring
[115] Fix | Delete
* credentials in the event they are needed.
[116] Fix | Delete
*/
[117] Fix | Delete
git_fetch_options fetch_opts;
[118] Fix | Delete
[119] Fix | Delete
/**
[120] Fix | Delete
* Set to zero (false) to create a standard repo, or non-zero
[121] Fix | Delete
* for a bare repo
[122] Fix | Delete
*/
[123] Fix | Delete
int bare;
[124] Fix | Delete
[125] Fix | Delete
/**
[126] Fix | Delete
* Whether to use a fetch or copy the object database.
[127] Fix | Delete
*/
[128] Fix | Delete
git_clone_local_t local;
[129] Fix | Delete
[130] Fix | Delete
/**
[131] Fix | Delete
* The name of the branch to checkout. NULL means use the
[132] Fix | Delete
* remote's default branch.
[133] Fix | Delete
*/
[134] Fix | Delete
const char* checkout_branch;
[135] Fix | Delete
[136] Fix | Delete
/**
[137] Fix | Delete
* A callback used to create the new repository into which to
[138] Fix | Delete
* clone. If NULL, the 'bare' field will be used to determine
[139] Fix | Delete
* whether to create a bare repository.
[140] Fix | Delete
*/
[141] Fix | Delete
git_repository_create_cb repository_cb;
[142] Fix | Delete
[143] Fix | Delete
/**
[144] Fix | Delete
* An opaque payload to pass to the git_repository creation callback.
[145] Fix | Delete
* This parameter is ignored unless repository_cb is non-NULL.
[146] Fix | Delete
*/
[147] Fix | Delete
void *repository_cb_payload;
[148] Fix | Delete
[149] Fix | Delete
/**
[150] Fix | Delete
* A callback used to create the git_remote, prior to its being
[151] Fix | Delete
* used to perform the clone operation. See the documentation for
[152] Fix | Delete
* git_remote_create_cb for details. This parameter may be NULL,
[153] Fix | Delete
* indicating that git_clone should provide default behavior.
[154] Fix | Delete
*/
[155] Fix | Delete
git_remote_create_cb remote_cb;
[156] Fix | Delete
[157] Fix | Delete
/**
[158] Fix | Delete
* An opaque payload to pass to the git_remote creation callback.
[159] Fix | Delete
* This parameter is ignored unless remote_cb is non-NULL.
[160] Fix | Delete
*/
[161] Fix | Delete
void *remote_cb_payload;
[162] Fix | Delete
} git_clone_options;
[163] Fix | Delete
[164] Fix | Delete
#define GIT_CLONE_OPTIONS_VERSION 1
[165] Fix | Delete
#define GIT_CLONE_OPTIONS_INIT { GIT_CLONE_OPTIONS_VERSION, \
[166] Fix | Delete
{ GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \
[167] Fix | Delete
GIT_FETCH_OPTIONS_INIT }
[168] Fix | Delete
[169] Fix | Delete
/**
[170] Fix | Delete
* Initialize git_clone_options structure
[171] Fix | Delete
*
[172] Fix | Delete
* Initializes a `git_clone_options` with default values. Equivalent to creating
[173] Fix | Delete
* an instance with GIT_CLONE_OPTIONS_INIT.
[174] Fix | Delete
*
[175] Fix | Delete
* @param opts The `git_clone_options` struct to initialize.
[176] Fix | Delete
* @param version The struct version; pass `GIT_CLONE_OPTIONS_VERSION`.
[177] Fix | Delete
* @return Zero on success; -1 on failure.
[178] Fix | Delete
*/
[179] Fix | Delete
GIT_EXTERN(int) git_clone_options_init(
[180] Fix | Delete
git_clone_options *opts,
[181] Fix | Delete
unsigned int version);
[182] Fix | Delete
[183] Fix | Delete
/**
[184] Fix | Delete
* Clone a remote repository.
[185] Fix | Delete
*
[186] Fix | Delete
* By default this creates its repository and initial remote to match
[187] Fix | Delete
* git's defaults. You can use the options in the callback to
[188] Fix | Delete
* customize how these are created.
[189] Fix | Delete
*
[190] Fix | Delete
* @param out pointer that will receive the resulting repository object
[191] Fix | Delete
* @param url the remote repository to clone
[192] Fix | Delete
* @param local_path local directory to clone to
[193] Fix | Delete
* @param options configuration options for the clone. If NULL, the
[194] Fix | Delete
* function works as though GIT_OPTIONS_INIT were passed.
[195] Fix | Delete
* @return 0 on success, any non-zero return value from a callback
[196] Fix | Delete
* function, or a negative value to indicate an error (use
[197] Fix | Delete
* `git_error_last` for a detailed error message)
[198] Fix | Delete
*/
[199] Fix | Delete
GIT_EXTERN(int) git_clone(
[200] Fix | Delete
git_repository **out,
[201] Fix | Delete
const char *url,
[202] Fix | Delete
const char *local_path,
[203] Fix | Delete
const git_clone_options *options);
[204] Fix | Delete
[205] Fix | Delete
/** @} */
[206] Fix | Delete
GIT_END_DECL
[207] Fix | Delete
#endif
[208] Fix | Delete
[209] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function