Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
aa2f68d8
Commit
aa2f68d8
authored
Aug 30, 2011
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #378 from kiryl/Wuninitialized
Wuninitialized
parents
420cbdc2
c75a890b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
src/common.h
+7
-2
src/errors.c
+2
-6
src/transport_git.c
+2
-0
No files found.
src/common.h
View file @
aa2f68d8
...
...
@@ -46,8 +46,13 @@ typedef SSIZE_T ssize_t;
#include "thread-utils.h"
#include "bswap.h"
extern
int
git__throw
(
int
error
,
const
char
*
,
...)
GIT_FORMAT_PRINTF
(
2
,
3
);
extern
int
git__rethrow
(
int
error
,
const
char
*
,
...)
GIT_FORMAT_PRINTF
(
2
,
3
);
extern
void
git___throw
(
const
char
*
,
...)
GIT_FORMAT_PRINTF
(
1
,
2
);
#define git__throw(error, ...) \
(git___throw(__VA_ARGS__), error)
extern
void
git___rethrow
(
const
char
*
,
...)
GIT_FORMAT_PRINTF
(
1
,
2
);
#define git__rethrow(error, ...) \
(git___rethrow(__VA_ARGS__), error)
#include "util.h"
...
...
src/errors.c
View file @
aa2f68d8
...
...
@@ -77,7 +77,7 @@ const char *git_strerror(int num)
return
"Unknown error"
;
}
int
git__rethrow
(
int
error
,
const
char
*
msg
,
...)
void
git___rethrow
(
const
char
*
msg
,
...)
{
char
new_error
[
1024
];
char
*
old_error
=
NULL
;
...
...
@@ -91,19 +91,15 @@ int git__rethrow(int error, const char *msg, ...)
old_error
=
strdup
(
g_last_error
);
snprintf
(
g_last_error
,
sizeof
(
g_last_error
),
"%s
\n
- %s"
,
new_error
,
old_error
);
free
(
old_error
);
return
error
;
}
int
git__throw
(
int
error
,
const
char
*
msg
,
...)
void
git___throw
(
const
char
*
msg
,
...)
{
va_list
va
;
va_start
(
va
,
msg
);
vsnprintf
(
g_last_error
,
sizeof
(
g_last_error
),
msg
,
va
);
va_end
(
va
);
return
error
;
}
const
char
*
git_lasterror
(
void
)
...
...
src/transport_git.c
View file @
aa2f68d8
...
...
@@ -151,6 +151,8 @@ static int do_connect(transport_git *t, const char *url)
url
+=
strlen
(
prefix
);
error
=
extract_host_and_port
(
&
host
,
&
port
,
url
);
if
(
error
<
GIT_SUCCESS
)
return
error
;
s
=
gitno_connect
(
host
,
port
);
connected
=
1
;
error
=
send_request
(
s
,
NULL
,
url
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment