File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -235,3 +235,13 @@ void treeish_to_tree(
235235 git_object_free (obj );
236236}
237237
238+ void * xrealloc (void * oldp , size_t newsz )
239+ {
240+ void * p = realloc (oldp , newsz );
241+ if (p == NULL ) {
242+ fprintf (stderr , "Cannot allocate memory, exiting.\n" );
243+ exit (1 );
244+ }
245+ return p ;
246+ }
247+
Original file line number Diff line number Diff line change @@ -103,3 +103,8 @@ extern int diff_output(
103103 */
104104extern void treeish_to_tree (
105105 git_tree * * out , git_repository * repo , const char * treeish );
106+
107+ /**
108+ * A realloc that exits on failure
109+ */
110+ extern void * xrealloc (void * oldp , size_t newsz );
Original file line number Diff line number Diff line change @@ -47,16 +47,6 @@ typedef struct {
4747
4848typedef struct args_info args_info ;
4949
50- static void * xrealloc (void * oldp , size_t newsz )
51- {
52- void * p = realloc (oldp , newsz );
53- if (p == NULL ) {
54- fprintf (stderr , "Cannot allocate memory, exiting.\n" );
55- exit (1 );
56- }
57- return p ;
58- }
59-
6050static void opts_add_commit (describe_options * opts , const char * commit )
6151{
6252 size_t sz ;
You can’t perform that action at this time.
0 commit comments