@@ -81,7 +81,7 @@ int git_commit_parse_existing(git_commit *commit)
8181 return 0 ;
8282
8383 if (git_odb_read (& commit_obj , commit -> object .pool -> db , & commit -> object .id ) < 0 )
84- return -1 ;
84+ return GIT_ENOTFOUND ;
8585
8686 if (commit_obj .type != GIT_OBJ_COMMIT )
8787 goto error_cleanup ;
@@ -128,27 +128,27 @@ git_commit *git_commit_lookup(git_revpool *pool, const git_oid *id)
128128int git_commit__parse_time (time_t * commit_time , char * buffer , const char * buffer_end )
129129{
130130 if (memcmp (buffer , "author " , 7 ) != 0 )
131- return -1 ;
131+ return GIT_EOBJCORRUPTED ;
132132
133133 buffer = memchr (buffer , '\n' , buffer_end - buffer );
134134 if (buffer == 0 || ++ buffer >= buffer_end )
135- return -1 ;
135+ return GIT_EOBJCORRUPTED ;
136136
137137 if (memcmp (buffer , "committer " , 10 ) != 0 )
138- return -1 ;
138+ return GIT_EOBJCORRUPTED ;
139139
140140 buffer = memchr (buffer , '>' , buffer_end - buffer );
141141 if (buffer == 0 || ++ buffer >= buffer_end )
142- return -1 ;
142+ return GIT_EOBJCORRUPTED ;
143143
144144 * commit_time = strtol (buffer , & buffer , 10 );
145145
146146 if (* commit_time == 0 )
147- return -1 ;
147+ return GIT_EOBJCORRUPTED ;
148148
149149 buffer = memchr (buffer , '\n' , buffer_end - buffer );
150150 if (buffer == 0 || ++ buffer >= buffer_end )
151- return -1 ;
151+ return GIT_EOBJCORRUPTED ;
152152
153153 return (buffer < buffer_end ) ? 0 : -1 ;
154154}
@@ -161,16 +161,16 @@ int git_commit__parse_oid(git_oid *oid, char **buffer_out, const char *buffer_en
161161 char * buffer = * buffer_out ;
162162
163163 if (buffer + (header_len + sha_len + 1 ) > buffer_end )
164- return -1 ;
164+ return GIT_EOBJCORRUPTED ;
165165
166166 if (memcmp (buffer , header , header_len ) != 0 )
167- return -1 ;
167+ return GIT_EOBJCORRUPTED ;
168168
169169 if (buffer [header_len + sha_len ] != '\n' )
170- return -1 ;
170+ return GIT_EOBJCORRUPTED ;
171171
172172 if (git_oid_mkstr (oid , buffer + header_len ) < 0 )
173- return -1 ;
173+ return GIT_EOBJCORRUPTED ;
174174
175175 * buffer_out = buffer + (header_len + sha_len + 1 );
176176
@@ -188,7 +188,7 @@ int git_commit__parse_buffer(git_commit *commit, void *data, size_t len)
188188 return 0 ;
189189
190190 if (git_commit__parse_oid (& oid , & buffer , buffer_end , "tree " ) < 0 )
191- return -1 ;
191+ return GIT_EOBJCORRUPTED ;
192192
193193 /*
194194 * TODO: load tree into commit object
@@ -199,7 +199,7 @@ int git_commit__parse_buffer(git_commit *commit, void *data, size_t len)
199199 git_commit * parent ;
200200
201201 if ((parent = git_commit_lookup (commit -> object .pool , & oid )) == NULL )
202- return -1 ;
202+ return GIT_ENOTFOUND ;
203203
204204 // Inherit uninteresting flag
205205 if (commit -> uninteresting )
@@ -209,21 +209,21 @@ int git_commit__parse_buffer(git_commit *commit, void *data, size_t len)
209209 }
210210
211211 if (git_commit__parse_time (& commit -> commit_time , buffer , buffer_end ) < 0 )
212- return -1 ;
212+ return GIT_EOBJCORRUPTED ;
213213
214214 commit -> parsed = 1 ;
215215
216216 return 0 ;
217217}
218218
219- void git_commit_list_push_back (git_commit_list * list , git_commit * commit )
219+ int git_commit_list_push_back (git_commit_list * list , git_commit * commit )
220220{
221221 git_commit_node * node = NULL ;
222222
223223 node = git__malloc (sizeof (git_commit_list ));
224224
225225 if (node == NULL )
226- return ;
226+ return GIT_ENOMEM ;
227227
228228 node -> commit = commit ;
229229 node -> next = NULL ;
@@ -237,16 +237,17 @@ void git_commit_list_push_back(git_commit_list *list, git_commit *commit)
237237 }
238238
239239 list -> size ++ ;
240+ return 0 ;
240241}
241242
242- void git_commit_list_push_front (git_commit_list * list , git_commit * commit )
243+ int git_commit_list_push_front (git_commit_list * list , git_commit * commit )
243244{
244245 git_commit_node * node = NULL ;
245246
246247 node = git__malloc (sizeof (git_commit_list ));
247248
248249 if (node == NULL )
249- return ;
250+ return GIT_ENOMEM ;
250251
251252 node -> commit = commit ;
252253 node -> next = list -> head ;
@@ -260,6 +261,7 @@ void git_commit_list_push_front(git_commit_list *list, git_commit *commit)
260261 }
261262
262263 list -> size ++ ;
264+ return 0 ;
263265}
264266
265267
0 commit comments