|
33 | 33 | */ |
34 | 34 | GIT_BEGIN_DECL |
35 | 35 |
|
| 36 | +/** Operation completed successfully. */ |
| 37 | +#define GIT_SUCCESS 0 |
| 38 | + |
| 39 | +/** |
| 40 | + * Operation failed, with unspecified reason. |
| 41 | + * This value also serves as the base error code; all other |
| 42 | + * error codes are subtracted from it such that all errors |
| 43 | + * are < 0, in typical POSIX C tradition. |
| 44 | + */ |
| 45 | +#define GIT_ERROR -1 |
| 46 | + |
| 47 | +/** Input was not a properly formatted Git object id. */ |
| 48 | +#define GIT_ENOTOID (GIT_ERROR - 1) |
| 49 | + |
| 50 | +/** Input does not exist in the scope searched. */ |
| 51 | +#define GIT_ENOTFOUND (GIT_ERROR - 2) |
| 52 | + |
| 53 | +/** Not enough space available. */ |
| 54 | +#define GIT_ENOMEM (GIT_ERROR - 3) |
| 55 | + |
| 56 | +/** Consult the OS error information. */ |
| 57 | +#define GIT_EOSERR (GIT_ERROR - 4) |
| 58 | + |
| 59 | +/** The specified object is of invalid type */ |
| 60 | +#define GIT_EOBJTYPE (GIT_ERROR - 5) |
| 61 | + |
| 62 | +/** The specified object has its data corrupted */ |
| 63 | +#define GIT_EOBJCORRUPTED (GIT_ERROR - 6) |
| 64 | + |
| 65 | +/** The specified repository is invalid */ |
| 66 | +#define GIT_ENOTAREPO (GIT_ERROR - 7) |
| 67 | + |
| 68 | +/** The object type is invalid or doesn't match */ |
| 69 | +#define GIT_EINVALIDTYPE (GIT_ERROR - 8) |
| 70 | + |
| 71 | +/** The object cannot be written because it's missing internal data */ |
| 72 | +#define GIT_EMISSINGOBJDATA (GIT_ERROR - 9) |
| 73 | + |
| 74 | +/** The packfile for the ODB is corrupted */ |
| 75 | +#define GIT_EPACKCORRUPTED (GIT_ERROR - 10) |
| 76 | + |
| 77 | +/** Failed to acquire or release a file lock */ |
| 78 | +#define GIT_EFLOCKFAIL (GIT_ERROR - 11) |
| 79 | + |
| 80 | +/** The Z library failed to inflate/deflate an object's data */ |
| 81 | +#define GIT_EZLIB (GIT_ERROR - 12) |
| 82 | + |
| 83 | +/** The queried object is currently busy */ |
| 84 | +#define GIT_EBUSY (GIT_ERROR - 13) |
| 85 | + |
| 86 | +/** The index file is not backed up by an existing repository */ |
| 87 | +#define GIT_EBAREINDEX (GIT_ERROR - 14) |
| 88 | + |
| 89 | +/** The name of the reference is not valid */ |
| 90 | +#define GIT_EINVALIDREFNAME (GIT_ERROR - 15) |
| 91 | + |
| 92 | +/** The specified reference has its data corrupted */ |
| 93 | +#define GIT_EREFCORRUPTED (GIT_ERROR - 16) |
| 94 | + |
| 95 | +/** The specified symbolic reference is too deeply nested */ |
| 96 | +#define GIT_ETOONESTEDSYMREF (GIT_ERROR - 17) |
| 97 | + |
| 98 | +/** The pack-refs file is either corrupted or its format is not currently supported */ |
| 99 | +#define GIT_EPACKEDREFSCORRUPTED (GIT_ERROR - 18) |
| 100 | + |
| 101 | +/** The path is invalid */ |
| 102 | +#define GIT_EINVALIDPATH (GIT_ERROR - 19) |
| 103 | + |
| 104 | +/** The revision walker is empty; there are no more commits left to iterate */ |
| 105 | +#define GIT_EREVWALKOVER (GIT_ERROR - 20) |
| 106 | + |
| 107 | +/** The state of the reference is not valid */ |
| 108 | +#define GIT_EINVALIDREFSTATE (GIT_ERROR - 21) |
| 109 | + |
| 110 | +/** This feature has not been implemented yet */ |
| 111 | +#define GIT_ENOTIMPLEMENTED (GIT_ERROR - 22) |
| 112 | + |
| 113 | +/** A reference with this name already exists */ |
| 114 | +#define GIT_EEXISTS (GIT_ERROR - 23) |
| 115 | + |
| 116 | +/** The given integer literal is too large to be parsed */ |
| 117 | +#define GIT_EOVERFLOW (GIT_ERROR - 24) |
| 118 | + |
| 119 | +/** The given literal is not a valid number */ |
| 120 | +#define GIT_ENOTNUM (GIT_ERROR - 25) |
| 121 | + |
| 122 | +/** Streaming error */ |
| 123 | +#define GIT_ESTREAM (GIT_ERROR - 26) |
| 124 | + |
| 125 | +/** invalid arguments to function */ |
| 126 | +#define GIT_EINVALIDARGS (GIT_ERROR - 27) |
| 127 | + |
| 128 | +/** |
| 129 | + * Return a detailed error string with the latest error |
| 130 | + * that occurred in the library. |
| 131 | + * @return a string explaining the error |
| 132 | + */ |
| 133 | +GIT_EXTERN(const char *) git_lasterror(void); |
| 134 | + |
36 | 135 | /** |
37 | 136 | * strerror() for the Git library |
| 137 | + * |
| 138 | + * Get a string description for a given error code. |
| 139 | + * NOTE: This method will be eventually deprecated in favor |
| 140 | + * of the new `git_lasterror`. |
| 141 | + * |
38 | 142 | * @param num The error code to explain |
39 | 143 | * @return a string explaining the error code |
40 | 144 | */ |
|
0 commit comments