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
924f5d12
Commit
924f5d12
authored
May 16, 2017
by
Carlos Martín Nieto
Committed by
GitHub
May 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4240 from pks-t/pks/fix-gcc-warnings
Fix GCC warnings
parents
87f5fbab
98a5f081
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
16 deletions
+26
-16
examples/network/common.c
+19
-5
src/odb.c
+5
-5
tests/clone/local.c
+2
-0
tests/threads/basic.c
+0
-6
No files found.
examples/network/common.c
View file @
924f5d12
#include "common.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
/* Shamelessly borrowed from http://stackoverflow.com/questions/3417837/
* with permission of the original author, Martin Pool.
...
...
@@ -20,15 +22,27 @@ int cred_acquire_cb(git_cred **out,
unsigned
int
UNUSED
(
allowed_types
),
void
*
UNUSED
(
payload
))
{
char
username
[
128
]
=
{
0
}
;
char
password
[
128
]
=
{
0
}
;
char
*
username
=
NULL
,
*
password
=
NULL
;
int
error
;
printf
(
"Username: "
);
scanf
(
"%s"
,
username
);
if
(
getline
(
&
username
,
NULL
,
stdin
)
<
0
)
{
fprintf
(
stderr
,
"Unable to read username: %s"
,
strerror
(
errno
));
return
-
1
;
}
/* Yup. Right there on your terminal. Careful where you copy/paste output. */
printf
(
"Password: "
);
scanf
(
"%s"
,
password
);
if
(
getline
(
&
password
,
NULL
,
stdin
)
<
0
)
{
fprintf
(
stderr
,
"Unable to read password: %s"
,
strerror
(
errno
));
free
(
username
);
return
-
1
;
}
return
git_cred_userpass_plaintext_new
(
out
,
username
,
password
);
error
=
git_cred_userpass_plaintext_new
(
out
,
username
,
password
);
free
(
username
);
free
(
password
);
return
error
;
}
src/odb.c
View file @
924f5d12
...
...
@@ -1002,7 +1002,7 @@ static int odb_read_1(git_odb_object **out, git_odb *db, const git_oid *id,
git_odb_object
*
object
;
git_oid
hashed
;
bool
found
=
false
;
int
error
;
int
error
=
0
;
if
(
!
only_refreshed
&&
odb_read_hardcoded
(
&
raw
,
id
)
==
0
)
found
=
true
;
...
...
@@ -1099,7 +1099,7 @@ static int read_prefix_1(git_odb_object **out, git_odb *db,
const
git_oid
*
key
,
size_t
len
,
bool
only_refreshed
)
{
size_t
i
;
int
error
;
int
error
=
0
;
git_oid
found_full_oid
=
{{
0
}};
git_rawobj
raw
=
{
0
};
void
*
data
=
NULL
;
...
...
@@ -1326,9 +1326,9 @@ static int git_odb_stream__invalid_length(
{
giterr_set
(
GITERR_ODB
,
"cannot %s - "
"Invalid length. %"
PRI
u
Z
" was expected. The "
"total size of the received chunks amounts to %"
PRI
u
Z
"."
,
action
,
stream
->
declared_size
,
stream
->
received_bytes
);
"Invalid length. %"
PRI
d
Z
" was expected. The "
"total size of the received chunks amounts to %"
PRI
d
Z
"."
,
action
,
stream
->
declared_size
,
stream
->
received_bytes
);
return
-
1
;
}
...
...
tests/clone/local.c
View file @
924f5d12
...
...
@@ -16,6 +16,7 @@ static int file_url(git_buf *buf, const char *host, const char *path)
return
git_buf_printf
(
buf
,
"file://%s/%s"
,
host
,
path
);
}
#ifdef GIT_WIN32
static
int
git_style_unc_path
(
git_buf
*
buf
,
const
char
*
host
,
const
char
*
path
)
{
git_buf_clear
(
buf
);
...
...
@@ -49,6 +50,7 @@ static int unc_path(git_buf *buf, const char *host, const char *path)
return
0
;
}
#endif
void
test_clone_local__should_clone_local
(
void
)
{
...
...
tests/threads/basic.c
View file @
924f5d12
...
...
@@ -54,12 +54,6 @@ static void *return_normally(void *param)
{
return
param
;
}
static
void
*
exit_abruptly
(
void
*
param
)
{
git_thread_exit
(
param
);
return
NULL
;
}
#endif
void
test_threads_basic__exit
(
void
)
...
...
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