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
94008e6a
Commit
94008e6a
authored
Aug 26, 2021
by
lhchavez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixups for the latest changes in the array interface
parent
47c70fc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
src/commit_graph.c
+21
-11
No files found.
src/commit_graph.c
View file @
94008e6a
...
@@ -832,7 +832,8 @@ static int compute_generation_numbers(git_vector *commits)
...
@@ -832,7 +832,8 @@ static int compute_generation_numbers(git_vector *commits)
*
(
size_t
*
)
git_array_alloc
(
index_stack
)
=
i
;
*
(
size_t
*
)
git_array_alloc
(
index_stack
)
=
i
;
while
(
git_array_size
(
index_stack
))
{
while
(
git_array_size
(
index_stack
))
{
i
=
*
git_array_pop
(
index_stack
);
size_t
*
index_ptr
=
git_array_pop
(
index_stack
);
i
=
*
index_ptr
;
child_packed_commit
=
git_vector_get
(
commits
,
i
);
child_packed_commit
=
git_vector_get
(
commits
,
i
);
if
(
commit_states
[
i
]
==
GENERATION_NUMBER_COMMIT_STATE_VISITED
)
{
if
(
commit_states
[
i
]
==
GENERATION_NUMBER_COMMIT_STATE_VISITED
)
{
...
@@ -1017,6 +1018,7 @@ commit_graph_write(git_commit_graph_writer *w, commit_graph_write_cb write_cb, v
...
@@ -1017,6 +1018,7 @@ commit_graph_write(git_commit_graph_writer *w, commit_graph_write_cb write_cb, v
uint64_t
commit_time
;
uint64_t
commit_time
;
uint32_t
generation
;
uint32_t
generation
;
uint32_t
word
;
uint32_t
word
;
size_t
*
packed_index
;
unsigned
int
parentcount
=
(
unsigned
int
)
git_array_size
(
packed_commit
->
parents
);
unsigned
int
parentcount
=
(
unsigned
int
)
git_array_size
(
packed_commit
->
parents
);
error
=
git_buf_put
(
error
=
git_buf_put
(
...
@@ -1026,20 +1028,24 @@ commit_graph_write(git_commit_graph_writer *w, commit_graph_write_cb write_cb, v
...
@@ -1026,20 +1028,24 @@ commit_graph_write(git_commit_graph_writer *w, commit_graph_write_cb write_cb, v
if
(
error
<
0
)
if
(
error
<
0
)
goto
cleanup
;
goto
cleanup
;
if
(
parentcount
==
0
)
if
(
parentcount
==
0
)
{
word
=
htonl
(
GIT_COMMIT_GRAPH_MISSING_PARENT
);
word
=
htonl
(
GIT_COMMIT_GRAPH_MISSING_PARENT
);
else
}
else
{
word
=
htonl
((
uint32_t
)
*
git_array_get
(
packed_commit
->
parent_indices
,
0
));
packed_index
=
git_array_get
(
packed_commit
->
parent_indices
,
0
);
word
=
htonl
((
uint32_t
)
*
packed_index
);
}
error
=
git_buf_put
(
&
commit_data
,
(
const
char
*
)
&
word
,
sizeof
(
word
));
error
=
git_buf_put
(
&
commit_data
,
(
const
char
*
)
&
word
,
sizeof
(
word
));
if
(
error
<
0
)
if
(
error
<
0
)
goto
cleanup
;
goto
cleanup
;
if
(
parentcount
<
2
)
if
(
parentcount
<
2
)
{
word
=
htonl
(
GIT_COMMIT_GRAPH_MISSING_PARENT
);
word
=
htonl
(
GIT_COMMIT_GRAPH_MISSING_PARENT
);
else
if
(
parentcount
==
2
)
}
else
if
(
parentcount
==
2
)
{
word
=
htonl
((
uint32_t
)
*
git_array_get
(
packed_commit
->
parent_indices
,
1
));
packed_index
=
git_array_get
(
packed_commit
->
parent_indices
,
1
);
else
word
=
htonl
((
uint32_t
)
*
packed_index
);
}
else
{
word
=
htonl
(
0x80000000u
|
extra_edge_list_count
);
word
=
htonl
(
0x80000000u
|
extra_edge_list_count
);
}
error
=
git_buf_put
(
&
commit_data
,
(
const
char
*
)
&
word
,
sizeof
(
word
));
error
=
git_buf_put
(
&
commit_data
,
(
const
char
*
)
&
word
,
sizeof
(
word
));
if
(
error
<
0
)
if
(
error
<
0
)
goto
cleanup
;
goto
cleanup
;
...
@@ -1047,9 +1053,13 @@ commit_graph_write(git_commit_graph_writer *w, commit_graph_write_cb write_cb, v
...
@@ -1047,9 +1053,13 @@ commit_graph_write(git_commit_graph_writer *w, commit_graph_write_cb write_cb, v
if
(
parentcount
>
2
)
{
if
(
parentcount
>
2
)
{
unsigned
int
parent_i
;
unsigned
int
parent_i
;
for
(
parent_i
=
1
;
parent_i
<
parentcount
;
++
parent_i
)
{
for
(
parent_i
=
1
;
parent_i
<
parentcount
;
++
parent_i
)
{
word
=
htonl
((
uint32_t
)(
packed_index
=
git_array_get
(
*
git_array_get
(
packed_commit
->
parent_indices
,
parent_i
)
packed_commit
->
parent_indices
,
parent_i
);
|
(
parent_i
+
1
==
parentcount
?
0x80000000u
:
0
)));
word
=
htonl
(
(
uint32_t
)(
*
packed_index
|
(
parent_i
+
1
==
parentcount
?
0x80000000u
:
0
)));
error
=
git_buf_put
(
error
=
git_buf_put
(
&
extra_edge_list
,
&
extra_edge_list
,
(
const
char
*
)
&
word
,
(
const
char
*
)
&
word
,
...
...
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