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
9da187e8
Commit
9da187e8
authored
Apr 09, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix clang warnings and improve checks
parent
94750e8a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
10 deletions
+19
-10
examples/network/fetch.c
+7
-3
examples/network/index-pack.c
+4
-3
examples/network/ls-remote.c
+6
-2
src/date.c
+2
-2
No files found.
examples/network/fetch.c
View file @
9da187e8
...
...
@@ -16,7 +16,7 @@ struct dl_data {
static
void
progress_cb
(
const
char
*
str
,
int
len
,
void
*
data
)
{
data
=
data
;
(
void
)
data
;
printf
(
"remote: %.*s"
,
len
,
str
);
fflush
(
stdout
);
/* We don't have the \n to force the flush */
}
...
...
@@ -50,7 +50,7 @@ exit:
static
int
update_cb
(
const
char
*
refname
,
const
git_oid
*
a
,
const
git_oid
*
b
,
void
*
data
)
{
char
a_str
[
GIT_OID_HEXSZ
+
1
],
b_str
[
GIT_OID_HEXSZ
+
1
];
data
=
data
;
(
void
)
data
;
git_oid_fmt
(
b_str
,
b
);
b_str
[
GIT_OID_HEXSZ
]
=
'\0'
;
...
...
@@ -76,7 +76,11 @@ int fetch(git_repository *repo, int argc, char **argv)
pthread_t
worker
;
#endif
argc
=
argc
;
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"usage: %s fetch <repo>
\n
"
,
argv
[
-
1
]);
return
EXIT_FAILURE
;
}
// Figure out whether it's a named remote or a URL
printf
(
"Fetching %s for repo %p
\n
"
,
argv
[
1
],
repo
);
if
(
git_remote_load
(
&
remote
,
repo
,
argv
[
1
])
<
0
)
{
...
...
examples/network/index-pack.c
View file @
9da187e8
...
...
@@ -23,7 +23,7 @@
// the indexing to finish in a worker thread
static
int
index_cb
(
const
git_transfer_progress
*
stats
,
void
*
data
)
{
data
=
data
;
(
void
)
data
;
printf
(
"
\r
Processing %d of %d"
,
stats
->
indexed_objects
,
stats
->
total_objects
);
return
0
;
...
...
@@ -39,9 +39,10 @@ int index_pack(git_repository *repo, int argc, char **argv)
ssize_t
read_bytes
;
char
buf
[
512
];
repo
=
repo
;
(
void
)
repo
;
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"
I need a packfile
\n
"
);
fprintf
(
stderr
,
"
usage: %s index-pack <packfile>
\n
"
,
argv
[
-
1
]
);
return
EXIT_FAILURE
;
}
...
...
examples/network/ls-remote.c
View file @
9da187e8
...
...
@@ -8,7 +8,7 @@ static int show_ref__cb(git_remote_head *head, void *payload)
{
char
oid
[
GIT_OID_HEXSZ
+
1
]
=
{
0
};
payload
=
payload
;
(
void
)
payload
;
git_oid_fmt
(
oid
,
&
head
->
oid
);
printf
(
"%s
\t
%s
\n
"
,
oid
,
head
->
name
);
return
0
;
...
...
@@ -67,7 +67,11 @@ int ls_remote(git_repository *repo, int argc, char **argv)
{
int
error
;
argc
=
argc
;
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"usage: %s ls-remote <remote>
\n
"
,
argv
[
-
1
]);
return
EXIT_FAILURE
;
}
/* If there's a ':' in the name, assume it's an URL */
if
(
strchr
(
argv
[
1
],
':'
)
!=
NULL
)
{
error
=
use_unnamed
(
repo
,
argv
[
1
]);
...
...
src/date.c
View file @
9da187e8
...
...
@@ -681,8 +681,8 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
const
char
*
end
=
date
;
int
i
;
while
(
isalpha
(
*++
end
))
;
;
while
(
isalpha
(
*++
end
))
/* scan to non-alpha */
;
for
(
i
=
0
;
i
<
12
;
i
++
)
{
size_t
match
=
match_string
(
date
,
month_names
[
i
]);
...
...
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