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
5aa10107
Commit
5aa10107
authored
Jan 12, 2017
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples: general: narrow down scope of loop variables
parent
8572e225
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
examples/general.c
+6
-4
No files found.
examples/general.c
View file @
5aa10107
...
@@ -644,10 +644,7 @@ static void index_walking(git_repository *repo)
...
@@ -644,10 +644,7 @@ static void index_walking(git_repository *repo)
static
void
reference_listing
(
git_repository
*
repo
)
static
void
reference_listing
(
git_repository
*
repo
)
{
{
git_strarray
ref_list
;
git_strarray
ref_list
;
const
char
*
refname
;
git_reference
*
ref
;
unsigned
i
;
unsigned
i
;
char
oid_hex
[
GIT_OID_HEXSZ
+
1
];
printf
(
"
\n
*Reference Listing*
\n
"
);
printf
(
"
\n
*Reference Listing*
\n
"
);
...
@@ -662,7 +659,10 @@ static void reference_listing(git_repository *repo)
...
@@ -662,7 +659,10 @@ static void reference_listing(git_repository *repo)
git_reference_list
(
&
ref_list
,
repo
);
git_reference_list
(
&
ref_list
,
repo
);
for
(
i
=
0
;
i
<
ref_list
.
count
;
++
i
)
{
for
(
i
=
0
;
i
<
ref_list
.
count
;
++
i
)
{
memset
(
oid_hex
,
0
,
sizeof
(
oid_hex
));
git_reference
*
ref
;
char
oid_hex
[
GIT_OID_HEXSZ
+
1
]
=
GIT_OID_HEX_ZERO
;
const
char
*
refname
;
refname
=
ref_list
.
strings
[
i
];
refname
=
ref_list
.
strings
[
i
];
git_reference_lookup
(
&
ref
,
repo
,
refname
);
git_reference_lookup
(
&
ref
,
repo
,
refname
);
...
@@ -679,6 +679,8 @@ static void reference_listing(git_repository *repo)
...
@@ -679,6 +679,8 @@ static void reference_listing(git_repository *repo)
fprintf
(
stderr
,
"Unexpected reference type
\n
"
);
fprintf
(
stderr
,
"Unexpected reference type
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
git_reference_free
(
ref
);
}
}
git_strarray_free
(
&
ref_list
);
git_strarray_free
(
&
ref_list
);
...
...
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