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
6238d81c
Commit
6238d81c
authored
Apr 06, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notes: support SHA256
parent
bd2c3786
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/libgit2/notes.c
+9
-8
No files found.
src/libgit2/notes.c
View file @
6238d81c
...
...
@@ -460,7 +460,7 @@ int git_note_commit_read(
{
int
error
;
git_tree
*
tree
=
NULL
;
char
target
[
GIT_OID_
SHA1
_HEXSIZE
+
1
];
char
target
[
GIT_OID_
MAX
_HEXSIZE
+
1
];
git_oid_tostr
(
target
,
sizeof
(
target
),
oid
);
...
...
@@ -507,7 +507,7 @@ int git_note_commit_create(
{
int
error
;
git_tree
*
tree
=
NULL
;
char
target
[
GIT_OID_
SHA1
_HEXSIZE
+
1
];
char
target
[
GIT_OID_
MAX
_HEXSIZE
+
1
];
git_oid_tostr
(
target
,
sizeof
(
target
),
oid
);
...
...
@@ -578,7 +578,7 @@ int git_note_commit_remove(
{
int
error
;
git_tree
*
tree
=
NULL
;
char
target
[
GIT_OID_
SHA1
_HEXSIZE
+
1
];
char
target
[
GIT_OID_
MAX
_HEXSIZE
+
1
];
git_oid_tostr
(
target
,
sizeof
(
target
),
oid
);
...
...
@@ -665,8 +665,9 @@ void git_note_free(git_note *note)
}
static
int
process_entry_path
(
const
char
*
entry_path
,
git_oid
*
annotated_object_id
)
git_oid
*
annotated_object_id
,
git_note_iterator
*
it
,
const
char
*
entry_path
)
{
int
error
=
0
;
size_t
i
=
0
,
j
=
0
,
len
;
...
...
@@ -698,12 +699,12 @@ static int process_entry_path(
buf
.
ptr
[
j
]
=
'\0'
;
buf
.
size
=
j
;
if
(
j
!=
GIT_OID_SHA1_HEXSIZE
)
{
if
(
j
!=
git_oid_hexsize
(
it
->
repo
->
oid_type
)
)
{
/* This is not a note entry */
goto
cleanup
;
}
error
=
git_oid__fromstr
(
annotated_object_id
,
buf
.
ptr
,
GIT_OID_SHA1
);
error
=
git_oid__fromstr
(
annotated_object_id
,
buf
.
ptr
,
it
->
repo
->
oid_type
);
cleanup:
git_str_dispose
(
&
buf
);
...
...
@@ -799,7 +800,7 @@ int git_note_next(
git_oid_cpy
(
note_id
,
&
item
->
id
);
if
((
error
=
process_entry_path
(
item
->
path
,
annotated_id
))
<
0
)
if
((
error
=
process_entry_path
(
annotated_id
,
it
,
item
->
path
))
<
0
)
return
error
;
if
((
error
=
git_iterator_advance
(
NULL
,
it
))
<
0
&&
error
!=
GIT_ITEROVER
)
...
...
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