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
bdeb8772
Commit
bdeb8772
authored
Jun 28, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
signature: add a dup function which takes a pool
This will be used by the transaction code.
parent
20363d58
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
src/signature.c
+24
-0
src/signature.h
+2
-0
No files found.
src/signature.c
View file @
bdeb8772
...
...
@@ -106,6 +106,30 @@ int git_signature_dup(git_signature **dest, const git_signature *source)
return
0
;
}
int
git_signature__pdup
(
git_signature
**
dest
,
const
git_signature
*
source
,
git_pool
*
pool
)
{
git_signature
*
signature
;
if
(
source
==
NULL
)
return
0
;
signature
=
git_pool_mallocz
(
pool
,
sizeof
(
git_signature
));
GITERR_CHECK_ALLOC
(
signature
);
signature
->
name
=
git_pool_strdup
(
pool
,
source
->
name
);
GITERR_CHECK_ALLOC
(
signature
->
name
);
signature
->
email
=
git_pool_strdup
(
pool
,
source
->
email
);
GITERR_CHECK_ALLOC
(
signature
->
email
);
signature
->
when
.
time
=
source
->
when
.
time
;
signature
->
when
.
offset
=
source
->
when
.
offset
;
*
dest
=
signature
;
return
0
;
}
int
git_signature_now
(
git_signature
**
sig_out
,
const
char
*
name
,
const
char
*
email
)
{
time_t
now
;
...
...
src/signature.h
View file @
bdeb8772
...
...
@@ -15,4 +15,6 @@
int
git_signature__parse
(
git_signature
*
sig
,
const
char
**
buffer_out
,
const
char
*
buffer_end
,
const
char
*
header
,
char
ender
);
void
git_signature__writebuf
(
git_buf
*
buf
,
const
char
*
header
,
const
git_signature
*
sig
);
int
git_signature__pdup
(
git_signature
**
dest
,
const
git_signature
*
source
,
git_pool
*
pool
);
#endif
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