Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/imh-pyth.../include/git2
File: errors.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_errors_h__
[6] Fix | Delete
#define INCLUDE_git_errors_h__
[7] Fix | Delete
[8] Fix | Delete
#include "common.h"
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* @file git2/errors.h
[12] Fix | Delete
* @brief Git error handling routines and variables
[13] Fix | Delete
* @ingroup Git
[14] Fix | Delete
* @{
[15] Fix | Delete
*/
[16] Fix | Delete
GIT_BEGIN_DECL
[17] Fix | Delete
[18] Fix | Delete
/** Generic return codes */
[19] Fix | Delete
typedef enum {
[20] Fix | Delete
GIT_OK = 0, /**< No error */
[21] Fix | Delete
[22] Fix | Delete
GIT_ERROR = -1, /**< Generic error */
[23] Fix | Delete
GIT_ENOTFOUND = -3, /**< Requested object could not be found */
[24] Fix | Delete
GIT_EEXISTS = -4, /**< Object exists preventing operation */
[25] Fix | Delete
GIT_EAMBIGUOUS = -5, /**< More than one object matches */
[26] Fix | Delete
GIT_EBUFS = -6, /**< Output buffer too short to hold data */
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* GIT_EUSER is a special error that is never generated by libgit2
[30] Fix | Delete
* code. You can return it from a callback (e.g to stop an iteration)
[31] Fix | Delete
* to know that it was generated by the callback and not by libgit2.
[32] Fix | Delete
*/
[33] Fix | Delete
GIT_EUSER = -7,
[34] Fix | Delete
[35] Fix | Delete
GIT_EBAREREPO = -8, /**< Operation not allowed on bare repository */
[36] Fix | Delete
GIT_EUNBORNBRANCH = -9, /**< HEAD refers to branch with no commits */
[37] Fix | Delete
GIT_EUNMERGED = -10, /**< Merge in progress prevented operation */
[38] Fix | Delete
GIT_ENONFASTFORWARD = -11, /**< Reference was not fast-forwardable */
[39] Fix | Delete
GIT_EINVALIDSPEC = -12, /**< Name/ref spec was not in a valid format */
[40] Fix | Delete
GIT_ECONFLICT = -13, /**< Checkout conflicts prevented operation */
[41] Fix | Delete
GIT_ELOCKED = -14, /**< Lock file prevented operation */
[42] Fix | Delete
GIT_EMODIFIED = -15, /**< Reference value does not match expected */
[43] Fix | Delete
GIT_EAUTH = -16, /**< Authentication error */
[44] Fix | Delete
GIT_ECERTIFICATE = -17, /**< Server certificate is invalid */
[45] Fix | Delete
GIT_EAPPLIED = -18, /**< Patch/merge has already been applied */
[46] Fix | Delete
GIT_EPEEL = -19, /**< The requested peel operation is not possible */
[47] Fix | Delete
GIT_EEOF = -20, /**< Unexpected EOF */
[48] Fix | Delete
GIT_EINVALID = -21, /**< Invalid operation or input */
[49] Fix | Delete
GIT_EUNCOMMITTED = -22, /**< Uncommitted changes in index prevented operation */
[50] Fix | Delete
GIT_EDIRECTORY = -23, /**< The operation is not valid for a directory */
[51] Fix | Delete
GIT_EMERGECONFLICT = -24, /**< A merge conflict exists and cannot continue */
[52] Fix | Delete
[53] Fix | Delete
GIT_PASSTHROUGH = -30, /**< A user-configured callback refused to act */
[54] Fix | Delete
GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */
[55] Fix | Delete
GIT_RETRY = -32, /**< Internal only */
[56] Fix | Delete
GIT_EMISMATCH = -33, /**< Hashsum mismatch in object */
[57] Fix | Delete
GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */
[58] Fix | Delete
GIT_EAPPLYFAIL = -35, /**< Patch application failed */
[59] Fix | Delete
} git_error_code;
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* Structure to store extra details of the last error that occurred.
[63] Fix | Delete
*
[64] Fix | Delete
* This is kept on a per-thread basis if GIT_THREADS was defined when the
[65] Fix | Delete
* library was build, otherwise one is kept globally for the library
[66] Fix | Delete
*/
[67] Fix | Delete
typedef struct {
[68] Fix | Delete
char *message;
[69] Fix | Delete
int klass;
[70] Fix | Delete
} git_error;
[71] Fix | Delete
[72] Fix | Delete
/** Error classes */
[73] Fix | Delete
typedef enum {
[74] Fix | Delete
GIT_ERROR_NONE = 0,
[75] Fix | Delete
GIT_ERROR_NOMEMORY,
[76] Fix | Delete
GIT_ERROR_OS,
[77] Fix | Delete
GIT_ERROR_INVALID,
[78] Fix | Delete
GIT_ERROR_REFERENCE,
[79] Fix | Delete
GIT_ERROR_ZLIB,
[80] Fix | Delete
GIT_ERROR_REPOSITORY,
[81] Fix | Delete
GIT_ERROR_CONFIG,
[82] Fix | Delete
GIT_ERROR_REGEX,
[83] Fix | Delete
GIT_ERROR_ODB,
[84] Fix | Delete
GIT_ERROR_INDEX,
[85] Fix | Delete
GIT_ERROR_OBJECT,
[86] Fix | Delete
GIT_ERROR_NET,
[87] Fix | Delete
GIT_ERROR_TAG,
[88] Fix | Delete
GIT_ERROR_TREE,
[89] Fix | Delete
GIT_ERROR_INDEXER,
[90] Fix | Delete
GIT_ERROR_SSL,
[91] Fix | Delete
GIT_ERROR_SUBMODULE,
[92] Fix | Delete
GIT_ERROR_THREAD,
[93] Fix | Delete
GIT_ERROR_STASH,
[94] Fix | Delete
GIT_ERROR_CHECKOUT,
[95] Fix | Delete
GIT_ERROR_FETCHHEAD,
[96] Fix | Delete
GIT_ERROR_MERGE,
[97] Fix | Delete
GIT_ERROR_SSH,
[98] Fix | Delete
GIT_ERROR_FILTER,
[99] Fix | Delete
GIT_ERROR_REVERT,
[100] Fix | Delete
GIT_ERROR_CALLBACK,
[101] Fix | Delete
GIT_ERROR_CHERRYPICK,
[102] Fix | Delete
GIT_ERROR_DESCRIBE,
[103] Fix | Delete
GIT_ERROR_REBASE,
[104] Fix | Delete
GIT_ERROR_FILESYSTEM,
[105] Fix | Delete
GIT_ERROR_PATCH,
[106] Fix | Delete
GIT_ERROR_WORKTREE,
[107] Fix | Delete
GIT_ERROR_SHA1,
[108] Fix | Delete
GIT_ERROR_HTTP,
[109] Fix | Delete
GIT_ERROR_INTERNAL
[110] Fix | Delete
} git_error_t;
[111] Fix | Delete
[112] Fix | Delete
/**
[113] Fix | Delete
* Return the last `git_error` object that was generated for the
[114] Fix | Delete
* current thread.
[115] Fix | Delete
*
[116] Fix | Delete
* The default behaviour of this function is to return NULL if no previous error has occurred.
[117] Fix | Delete
* However, libgit2's error strings are not cleared aggressively, so a prior
[118] Fix | Delete
* (unrelated) error may be returned. This can be avoided by only calling
[119] Fix | Delete
* this function if the prior call to a libgit2 API returned an error.
[120] Fix | Delete
*
[121] Fix | Delete
* @return A git_error object.
[122] Fix | Delete
*/
[123] Fix | Delete
GIT_EXTERN(const git_error *) git_error_last(void);
[124] Fix | Delete
[125] Fix | Delete
/**
[126] Fix | Delete
* Clear the last library error that occurred for this thread.
[127] Fix | Delete
*/
[128] Fix | Delete
GIT_EXTERN(void) git_error_clear(void);
[129] Fix | Delete
[130] Fix | Delete
/**
[131] Fix | Delete
* Set the error message string for this thread.
[132] Fix | Delete
*
[133] Fix | Delete
* This function is public so that custom ODB backends and the like can
[134] Fix | Delete
* relay an error message through libgit2. Most regular users of libgit2
[135] Fix | Delete
* will never need to call this function -- actually, calling it in most
[136] Fix | Delete
* circumstances (for example, calling from within a callback function)
[137] Fix | Delete
* will just end up having the value overwritten by libgit2 internals.
[138] Fix | Delete
*
[139] Fix | Delete
* This error message is stored in thread-local storage and only applies
[140] Fix | Delete
* to the particular thread that this libgit2 call is made from.
[141] Fix | Delete
*
[142] Fix | Delete
* @param error_class One of the `git_error_t` enum above describing the
[143] Fix | Delete
* general subsystem that is responsible for the error.
[144] Fix | Delete
* @param string The formatted error message to keep
[145] Fix | Delete
* @return 0 on success or -1 on failure
[146] Fix | Delete
*/
[147] Fix | Delete
GIT_EXTERN(int) git_error_set_str(int error_class, const char *string);
[148] Fix | Delete
[149] Fix | Delete
/**
[150] Fix | Delete
* Set the error message to a special value for memory allocation failure.
[151] Fix | Delete
*
[152] Fix | Delete
* The normal `git_error_set_str()` function attempts to `strdup()` the
[153] Fix | Delete
* string that is passed in. This is not a good idea when the error in
[154] Fix | Delete
* question is a memory allocation failure. That circumstance has a
[155] Fix | Delete
* special setter function that sets the error string to a known and
[156] Fix | Delete
* statically allocated internal value.
[157] Fix | Delete
*/
[158] Fix | Delete
GIT_EXTERN(void) git_error_set_oom(void);
[159] Fix | Delete
[160] Fix | Delete
/** @} */
[161] Fix | Delete
GIT_END_DECL
[162] Fix | Delete
#endif
[163] Fix | Delete
[164] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function