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
c0178ef3
Commit
c0178ef3
authored
Apr 05, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs: honor sha256 during allocation
parent
523f893f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
src/libgit2/refs.c
+8
-1
No files found.
src/libgit2/refs.c
View file @
c0178ef3
...
...
@@ -72,6 +72,7 @@ git_reference *git_reference__alloc(
const
git_oid
*
oid
,
const
git_oid
*
peel
)
{
git_oid_t
oid_type
;
git_reference
*
ref
;
GIT_ASSERT_ARG_WITH_RETVAL
(
name
,
NULL
);
...
...
@@ -84,10 +85,16 @@ git_reference *git_reference__alloc(
ref
->
type
=
GIT_REFERENCE_DIRECT
;
git_oid_cpy
(
&
ref
->
target
.
oid
,
oid
);
#ifdef GIT_EXPERIMENTAL_SHA256
oid_type
=
oid
->
type
;
#else
oid_type
=
GIT_OID_SHA1
;
#endif
if
(
peel
!=
NULL
)
git_oid_cpy
(
&
ref
->
peel
,
peel
);
else
git_oid_clear
(
&
ref
->
peel
,
GIT_OID_SHA1
);
git_oid_clear
(
&
ref
->
peel
,
oid_type
);
return
ref
;
}
...
...
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