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
369b0217
Commit
369b0217
authored
Oct 13, 2014
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up various compiler warnings
parent
70f7e2c6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
11 deletions
+20
-11
src/describe.c
+3
-2
src/thread-utils.h
+4
-2
src/transaction.c
+3
-3
src/transports/http.c
+5
-2
src/transports/ssh.c
+5
-2
No files found.
src/describe.c
View file @
369b0217
...
...
@@ -397,7 +397,7 @@ static int show_suffix(
const
git_oid
*
id
,
size_t
abbrev_size
)
{
int
error
,
size
;
int
error
,
size
=
0
;
char
hex_oid
[
GIT_OID_HEXSZ
];
...
...
@@ -818,7 +818,8 @@ int git_describe_format(git_buf *out, const git_describe_result *result, const g
/* If we didn't find *any* tags, we fall back to the commit's id */
if
(
result
->
fallback_to_id
)
{
char
hex_oid
[
GIT_OID_HEXSZ
+
1
]
=
{
0
};
int
size
;
int
size
=
0
;
if
((
error
=
find_unique_abbrev_size
(
&
size
,
repo
,
&
result
->
commit_id
,
opts
.
abbreviated_size
))
<
0
)
return
-
1
;
...
...
src/thread-utils.h
View file @
369b0217
...
...
@@ -183,8 +183,10 @@ GIT_INLINE(int64_t) git_atomic64_add(git_atomic64 *a, int64_t addend)
/* Pthreads Mutex */
#define git_mutex unsigned int
static
int
git_mutex_init
(
git_mutex
*
mutex
)
{
GIT_UNUSED
(
mutex
);
return
0
;
}
static
int
git_mutex_lock
(
git_mutex
*
mutex
)
{
GIT_UNUSED
(
mutex
);
return
0
;
}
GIT_INLINE
(
int
)
git_mutex_init
(
git_mutex
*
mutex
)
\
{
GIT_UNUSED
(
mutex
);
return
0
;
}
GIT_INLINE
(
int
)
git_mutex_lock
(
git_mutex
*
mutex
)
\
{
GIT_UNUSED
(
mutex
);
return
0
;
}
#define git_mutex_unlock(a) (void)0
#define git_mutex_free(a) (void)0
...
...
src/transaction.c
View file @
369b0217
...
...
@@ -274,7 +274,7 @@ static int update_target(git_refdb *db, transaction_node *node)
}
else
if
(
node
->
ref_type
==
GIT_REF_SYMBOLIC
)
{
ref
=
git_reference__alloc_symbolic
(
node
->
name
,
node
->
target
.
symbolic
);
}
else
{
a
ssert
(
0
);
a
bort
(
);
}
GITERR_CHECK_ALLOC
(
ref
);
...
...
@@ -287,7 +287,7 @@ static int update_target(git_refdb *db, transaction_node *node)
}
else
if
(
node
->
ref_type
==
GIT_REF_SYMBOLIC
)
{
error
=
git_refdb_unlock
(
db
,
node
->
payload
,
true
,
update_reflog
,
ref
,
node
->
sig
,
node
->
message
);
}
else
{
a
ssert
(
0
);
a
bort
(
);
}
git_reference_free
(
ref
);
...
...
@@ -300,7 +300,7 @@ int git_transaction_commit(git_transaction *tx)
{
transaction_node
*
node
;
git_strmap_iter
pos
;
int
error
;
int
error
=
0
;
assert
(
tx
);
...
...
src/transports/http.c
View file @
369b0217
...
...
@@ -552,7 +552,7 @@ static int http_connect(http_subtransport *t)
#ifdef GIT_SSL
if
((
!
error
||
error
==
GIT_ECERTIFICATE
)
&&
t
->
owner
->
certificate_check_cb
!=
NULL
)
{
X509
*
cert
=
SSL_get_peer_certificate
(
t
->
socket
.
ssl
.
ssl
);
git_cert_x509
cert_info
;
git_cert_x509
cert_info
,
*
cert_info_ptr
;
int
len
,
is_valid
;
unsigned
char
*
guard
,
*
encoded_cert
;
...
...
@@ -581,7 +581,10 @@ static int http_connect(http_subtransport *t)
cert_info
.
cert_type
=
GIT_CERT_X509
;
cert_info
.
data
=
encoded_cert
;
cert_info
.
len
=
len
;
error
=
t
->
owner
->
certificate_check_cb
((
git_cert
*
)
&
cert_info
,
is_valid
,
t
->
connection_data
.
host
,
t
->
owner
->
message_cb_payload
);
cert_info_ptr
=
&
cert_info
;
error
=
t
->
owner
->
certificate_check_cb
((
git_cert
*
)
cert_info_ptr
,
is_valid
,
t
->
connection_data
.
host
,
t
->
owner
->
message_cb_payload
);
git__free
(
encoded_cert
);
if
(
error
<
0
)
{
...
...
src/transports/ssh.c
View file @
369b0217
...
...
@@ -480,7 +480,7 @@ static int _git_ssh_setup_conn(
goto
on_error
;
if
(
t
->
owner
->
certificate_check_cb
!=
NULL
)
{
git_cert_hostkey
cert
=
{
0
};
git_cert_hostkey
cert
=
{
0
}
,
*
cert_ptr
;
const
char
*
key
;
cert
.
cert_type
=
GIT_CERT_HOSTKEY_LIBSSH2
;
...
...
@@ -504,7 +504,10 @@ static int _git_ssh_setup_conn(
/* We don't currently trust any hostkeys */
giterr_clear
();
error
=
t
->
owner
->
certificate_check_cb
((
git_cert
*
)
&
cert
,
0
,
host
,
t
->
owner
->
message_cb_payload
);
cert_ptr
=
&
cert
;
error
=
t
->
owner
->
certificate_check_cb
((
git_cert
*
)
cert_ptr
,
0
,
host
,
t
->
owner
->
message_cb_payload
);
if
(
error
<
0
)
{
if
(
!
giterr_last
())
giterr_set
(
GITERR_NET
,
"user cancelled hostkey check"
);
...
...
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