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
f4774446
Commit
f4774446
authored
Apr 08, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge: support sha256
parent
47868ee4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
src/libgit2/annotated_commit.c
+2
-2
src/libgit2/annotated_commit.h
+1
-1
src/libgit2/merge.c
+5
-3
No files found.
src/libgit2/annotated_commit.c
View file @
f4774446
...
...
@@ -39,8 +39,8 @@ static int annotated_commit_init(
if
((
error
=
git_commit_dup
(
&
annotated_commit
->
commit
,
commit
))
<
0
)
goto
done
;
git_oid_
fmt
(
annotated_commit
->
id_str
,
git_commit_id
(
commit
));
annotated_commit
->
id_str
[
GIT_OID_SHA1_HEXSIZE
]
=
'\0'
;
git_oid_
tostr
(
annotated_commit
->
id_str
,
GIT_OID_MAX_HEXSIZE
+
1
,
git_commit_id
(
commit
))
;
if
(
!
description
)
description
=
annotated_commit
->
id_str
;
...
...
src/libgit2/annotated_commit.h
View file @
f4774446
...
...
@@ -41,7 +41,7 @@ struct git_annotated_commit {
const
char
*
ref_name
;
const
char
*
remote_url
;
char
id_str
[
GIT_OID_
SHA1_HEXSIZE
+
1
];
char
id_str
[
GIT_OID_
MAX_HEXSIZE
+
1
];
};
extern
int
git_annotated_commit_from_head
(
git_annotated_commit
**
out
,
...
...
src/libgit2/merge.c
View file @
f4774446
...
...
@@ -611,13 +611,13 @@ int git_repository_mergehead_foreach(
buffer
=
merge_head_file
.
ptr
;
while
((
line
=
git__strsep
(
&
buffer
,
"
\n
"
))
!=
NULL
)
{
if
(
strlen
(
line
)
!=
GIT_OID_SHA1_HEXSIZE
)
{
if
(
strlen
(
line
)
!=
git_oid_hexsize
(
repo
->
oid_type
)
)
{
git_error_set
(
GIT_ERROR_INVALID
,
"unable to parse OID - invalid length"
);
error
=
-
1
;
goto
cleanup
;
}
if
((
error
=
git_oid__fromstr
(
&
oid
,
line
,
GIT_OID_SHA1
))
<
0
)
if
((
error
=
git_oid__fromstr
(
&
oid
,
line
,
repo
->
oid_type
))
<
0
)
goto
cleanup
;
if
((
error
=
cb
(
&
oid
,
payload
))
!=
0
)
{
...
...
@@ -1061,7 +1061,7 @@ static int index_entry_similarity_calc(
const
git_merge_options
*
opts
)
{
git_blob
*
blob
;
git_diff_file
diff_file
=
{
GIT_OID_SHA1_ZERO
}
;
git_diff_file
diff_file
;
git_object_size_t
blobsize
;
int
error
;
...
...
@@ -1070,6 +1070,8 @@ static int index_entry_similarity_calc(
*
out
=
NULL
;
git_oid_clear
(
&
diff_file
.
id
,
repo
->
oid_type
);
if
((
error
=
git_blob_lookup
(
&
blob
,
repo
,
&
entry
->
id
))
<
0
)
return
error
;
...
...
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