-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy patherror.nobj.lua
More file actions
137 lines (135 loc) · 4.03 KB
/
Copy patherror.nobj.lua
File metadata and controls
137 lines (135 loc) · 4.03 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
-- Copyright (c) 2010-2012 by Robert G. Jakabosky <bobby@sharedrealm.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
-- Convert Git Error codes into strings.
error_code "GitError" "int" {
is_error_check = function(rec) return "(GIT_OK != ${" .. rec.name .. "})" end,
default = "GIT_OK",
c_source [[
const git_error *giterr;
switch(err) {
case GIT_ERROR:
giterr = giterr_last();
err_str = giterr->message;
break;
case GIT_ENOTFOUND:
err_str = "Requested object could not be found";
break;
case GIT_EEXISTS:
err_str = "Object exists preventing operation";
break;
case GIT_EAMBIGUOUS:
err_str = "More than one object matches";
break;
case GIT_EBUFS:
err_str = "Output buffer too short to hold data";
break;
case GIT_EUSER:
err_str = "a special error that is never generated by libgit2 code";
break;
case GIT_EBAREREPO:
err_str = "Operation not allowed on bare repository";
break;
case GIT_EUNBORNBRANCH:
err_str = "HEAD refers to branch with no commits";
break;
case GIT_EUNMERGED:
err_str = "Merge in progress prevented operation";
break;
case GIT_ENONFASTFORWARD:
err_str = "Reference was not fast-forwardable";
break;
case GIT_EINVALIDSPEC:
err_str = "Name/ref spec was not in a valid format";
break;
case GIT_ECONFLICT:
err_str = "Checkout conflicts prevented operation";
break;
case GIT_ELOCKED:
err_str = "Lock file prevented operation";
break;
case GIT_EMODIFIED:
err_str = "Reference value does not match expected";
break;
case GIT_EAUTH:
err_str = "Authentication error";
break;
case GIT_ECERTIFICATE:
err_str = "Server certificate is invalid";
break;
case GIT_EAPPLIED:
err_str = "Patch/merge has already been applied";
break;
case GIT_EPEEL:
err_str = "The requested peel operation is not possible";
break;
case GIT_EEOF:
err_str = "Unexpected EOF";
break;
case GIT_EINVALID:
err_str = "Invalid operation or input";
break;
case GIT_EUNCOMMITTED:
err_str = "Uncommitted changes in index prevented operation";
break;
case GIT_EDIRECTORY:
err_str = "The operation is not valid for a directory";
break;
case GIT_EMERGECONFLICT:
err_str = "A merge conflict exists and cannot continue";
break;
case GIT_PASSTHROUGH:
err_str = "A user-configured callback refused to act";
break;
case GIT_ITEROVER:
err_str = "Signals end of iteration with iterator";
break;
case GIT_RETRY:
err_str = "Internal only";
break;
case GIT_EMISMATCH:
err_str = "Hashsum mismatch in object";
break;
case GIT_EINDEXDIRTY:
err_str = "Unsaved changes in the index would be overwritten";
break;
case GIT_EAPPLYFAIL:
err_str = "Patch application failed";
break;
case GIT_EOWNER:
err_str = "The object is not owned by the current user";
break;
case GIT_TIMEOUT:
err_str = "The operation timed out";
break;
case GIT_EUNCHANGED:
err_str = "There were no changes";
break;
case GIT_ENOTSUPPORTED:
err_str = "An option is not supported";
break;
case GIT_EREADONLY:
err_str = "The subject is read-only";
break;
case GIT_OK:
default:
break;
}
]],
}