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
26b9c056
Commit
26b9c056
authored
Apr 09, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ident: support sha256
parent
cf06de46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/libgit2/ident.c
+3
-3
No files found.
src/libgit2/ident.c
View file @
26b9c056
...
@@ -42,7 +42,7 @@ static int ident_find_id(
...
@@ -42,7 +42,7 @@ static int ident_find_id(
static
int
ident_insert_id
(
static
int
ident_insert_id
(
git_str
*
to
,
const
git_str
*
from
,
const
git_filter_source
*
src
)
git_str
*
to
,
const
git_str
*
from
,
const
git_filter_source
*
src
)
{
{
char
oid
[
GIT_OID_
SHA1_HEXSIZE
+
1
];
char
oid
[
GIT_OID_
MAX_HEXSIZE
+
1
];
const
char
*
id_start
,
*
id_end
,
*
from_end
=
from
->
ptr
+
from
->
size
;
const
char
*
id_start
,
*
id_end
,
*
from_end
=
from
->
ptr
+
from
->
size
;
size_t
need_size
;
size_t
need_size
;
...
@@ -57,7 +57,7 @@ static int ident_insert_id(
...
@@ -57,7 +57,7 @@ static int ident_insert_id(
return
GIT_PASSTHROUGH
;
return
GIT_PASSTHROUGH
;
need_size
=
(
size_t
)(
id_start
-
from
->
ptr
)
+
need_size
=
(
size_t
)(
id_start
-
from
->
ptr
)
+
5
/* "$Id: " */
+
GIT_OID_
SHA1
_HEXSIZE
+
2
/* " $" */
+
5
/* "$Id: " */
+
GIT_OID_
MAX
_HEXSIZE
+
2
/* " $" */
+
(
size_t
)(
from_end
-
id_end
);
(
size_t
)(
from_end
-
id_end
);
if
(
git_str_grow
(
to
,
need_size
)
<
0
)
if
(
git_str_grow
(
to
,
need_size
)
<
0
)
...
@@ -65,7 +65,7 @@ static int ident_insert_id(
...
@@ -65,7 +65,7 @@ static int ident_insert_id(
git_str_set
(
to
,
from
->
ptr
,
(
size_t
)(
id_start
-
from
->
ptr
));
git_str_set
(
to
,
from
->
ptr
,
(
size_t
)(
id_start
-
from
->
ptr
));
git_str_put
(
to
,
"$Id: "
,
5
);
git_str_put
(
to
,
"$Id: "
,
5
);
git_str_put
(
to
,
oid
,
GIT_OID_SHA1_HEXSIZE
);
git_str_put
s
(
to
,
oid
);
git_str_put
(
to
,
" $"
,
2
);
git_str_put
(
to
,
" $"
,
2
);
git_str_put
(
to
,
id_end
,
(
size_t
)(
from_end
-
id_end
));
git_str_put
(
to
,
id_end
,
(
size_t
)(
from_end
-
id_end
));
...
...
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