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
72f8da91
Commit
72f8da91
authored
9 years ago
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3089 from volftomas/patch-2
Added call to git_libgit2_shutdown()
parents
ef23a82f
785990be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
examples/network/git2.c
+12
-5
No files found.
examples/network/git2.c
View file @
72f8da91
...
...
@@ -23,8 +23,8 @@ static int run_command(git_cb fn, int argc, char **argv)
int
error
;
git_repository
*
repo
;
// Before running the actual command, create an instance of the local
// repository and pass it to the function.
// Before running the actual command, create an instance of the local
// repository and pass it to the function.
error
=
git_repository_open
(
&
repo
,
".git"
);
if
(
error
<
0
)
...
...
@@ -48,6 +48,7 @@ static int run_command(git_cb fn, int argc, char **argv)
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
int
return_code
=
1
;
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"usage: %s <cmd> [repo]
\n
"
,
argv
[
0
]);
...
...
@@ -57,10 +58,16 @@ int main(int argc, char **argv)
git_libgit2_init
();
for
(
i
=
0
;
commands
[
i
].
name
!=
NULL
;
++
i
)
{
if
(
!
strcmp
(
argv
[
1
],
commands
[
i
].
name
))
return
run_command
(
commands
[
i
].
fn
,
--
argc
,
++
argv
);
if
(
!
strcmp
(
argv
[
1
],
commands
[
i
].
name
))
{
return_code
=
run_command
(
commands
[
i
].
fn
,
--
argc
,
++
argv
);
goto
shutdown
;
}
}
fprintf
(
stderr
,
"Command not found: %s
\n
"
,
argv
[
1
]);
return
1
;
shutdown:
git_libgit2_shutdown
();
return
return_code
;
}
This diff is collapsed.
Click to expand it.
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