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
d1c92a95
Commit
d1c92a95
authored
Apr 05, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refdb: handle SHA256 references
parent
93e55a02
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
src/libgit2/parse.c
+7
-4
src/libgit2/parse.h
+1
-1
src/libgit2/refdb_fs.c
+2
-2
No files found.
src/libgit2/parse.c
View file @
d1c92a95
...
@@ -102,13 +102,16 @@ int git_parse_advance_digit(int64_t *out, git_parse_ctx *ctx, int base)
...
@@ -102,13 +102,16 @@ int git_parse_advance_digit(int64_t *out, git_parse_ctx *ctx, int base)
return
0
;
return
0
;
}
}
int
git_parse_advance_oid
(
git_oid
*
out
,
git_parse_ctx
*
ctx
)
int
git_parse_advance_oid
(
git_oid
*
out
,
git_parse_ctx
*
ctx
,
git_oid_t
oid_type
)
{
{
if
(
ctx
->
line_len
<
GIT_OID_SHA1_HEXSIZE
)
size_t
oid_hexsize
=
git_oid_hexsize
(
oid_type
);
GIT_ASSERT
(
oid_hexsize
);
if
(
ctx
->
line_len
<
oid_hexsize
)
return
-
1
;
return
-
1
;
if
((
git_oid__fromstrn
(
out
,
ctx
->
line
,
GIT_OID_SHA1_HEXSIZE
,
GIT_OID_SHA1
))
<
0
)
if
((
git_oid__fromstrn
(
out
,
ctx
->
line
,
oid_hexsize
,
oid_type
))
<
0
)
return
-
1
;
return
-
1
;
git_parse_advance_chars
(
ctx
,
GIT_OID_SHA1_HEXSIZE
);
git_parse_advance_chars
(
ctx
,
oid_hexsize
);
return
0
;
return
0
;
}
}
...
...
src/libgit2/parse.h
View file @
d1c92a95
...
@@ -50,7 +50,7 @@ int git_parse_advance_expected(
...
@@ -50,7 +50,7 @@ int git_parse_advance_expected(
int
git_parse_advance_ws
(
git_parse_ctx
*
ctx
);
int
git_parse_advance_ws
(
git_parse_ctx
*
ctx
);
int
git_parse_advance_nl
(
git_parse_ctx
*
ctx
);
int
git_parse_advance_nl
(
git_parse_ctx
*
ctx
);
int
git_parse_advance_digit
(
int64_t
*
out
,
git_parse_ctx
*
ctx
,
int
base
);
int
git_parse_advance_digit
(
int64_t
*
out
,
git_parse_ctx
*
ctx
,
int
base
);
int
git_parse_advance_oid
(
git_oid
*
out
,
git_parse_ctx
*
ctx
);
int
git_parse_advance_oid
(
git_oid
*
out
,
git_parse_ctx
*
ctx
,
git_oid_t
oid_type
);
enum
GIT_PARSE_PEEK_FLAGS
{
enum
GIT_PARSE_PEEK_FLAGS
{
GIT_PARSE_PEEK_SKIP_WHITESPACE
=
(
1
<<
0
)
GIT_PARSE_PEEK_SKIP_WHITESPACE
=
(
1
<<
0
)
...
...
src/libgit2/refdb_fs.c
View file @
d1c92a95
...
@@ -1949,9 +1949,9 @@ static int reflog_parse(git_reflog *log, const char *buf, size_t buf_size)
...
@@ -1949,9 +1949,9 @@ static int reflog_parse(git_reflog *log, const char *buf, size_t buf_size)
entry
->
committer
=
git__calloc
(
1
,
sizeof
(
*
entry
->
committer
));
entry
->
committer
=
git__calloc
(
1
,
sizeof
(
*
entry
->
committer
));
GIT_ERROR_CHECK_ALLOC
(
entry
->
committer
);
GIT_ERROR_CHECK_ALLOC
(
entry
->
committer
);
if
(
git_parse_advance_oid
(
&
entry
->
oid_old
,
&
parser
)
<
0
||
if
(
git_parse_advance_oid
(
&
entry
->
oid_old
,
&
parser
,
log
->
oid_type
)
<
0
||
git_parse_advance_expected
(
&
parser
,
" "
,
1
)
<
0
||
git_parse_advance_expected
(
&
parser
,
" "
,
1
)
<
0
||
git_parse_advance_oid
(
&
entry
->
oid_cur
,
&
parser
)
<
0
)
git_parse_advance_oid
(
&
entry
->
oid_cur
,
&
parser
,
log
->
oid_type
)
<
0
)
goto
next
;
goto
next
;
sig
=
parser
.
line
;
sig
=
parser
.
line
;
...
...
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