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
d483a911
Commit
d483a911
authored
Jul 08, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
signature: Fix optional header
parent
27df4275
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
15 deletions
+8
-15
src/commit.c
+2
-2
src/signature.c
+4
-10
src/tag.c
+2
-3
No files found.
src/commit.c
View file @
d483a911
...
@@ -125,8 +125,8 @@ int git_commit_create(
...
@@ -125,8 +125,8 @@ int git_commit_create(
git_odb_stream
*
stream
;
git_odb_stream
*
stream
;
message_length
=
strlen
(
message
);
message_length
=
strlen
(
message
);
author_length
=
git_signature__write
(
&
author_str
,
"author"
,
author
);
author_length
=
git_signature__write
(
&
author_str
,
"author
"
,
author
);
committer_length
=
git_signature__write
(
&
committer_str
,
"committer"
,
committer
);
committer_length
=
git_signature__write
(
&
committer_str
,
"committer
"
,
committer
);
if
(
author_length
<
0
||
committer_length
<
0
)
if
(
author_length
<
0
||
committer_length
<
0
)
return
git__throw
(
GIT_EINVALIDARGS
,
"Cannot create commit. Failed to parse signature"
);
return
git__throw
(
GIT_EINVALIDARGS
,
"Cannot create commit. Failed to parse signature"
);
...
...
src/signature.c
View file @
d483a911
...
@@ -330,16 +330,10 @@ int git_signature__write(char **signature, const char *header, const git_signatu
...
@@ -330,16 +330,10 @@ int git_signature__write(char **signature, const char *header, const git_signatu
hours
=
offset
/
60
;
hours
=
offset
/
60
;
mins
=
offset
%
60
;
mins
=
offset
%
60
;
if
(
header
)
sig_buffer_len
=
snprintf
(
sig_buffer
,
sizeof
(
sig_buffer
),
sig_buffer_len
=
snprintf
(
sig_buffer
,
sizeof
(
sig_buffer
),
"%s%s <%s> %u %c%02d%02d
\n
"
,
"%s %s <%s> %u %c%02d%02d
\n
"
,
header
?
header
:
""
,
sig
->
name
,
sig
->
email
,
header
,
sig
->
name
,
sig
->
email
,
(
unsigned
)
sig
->
when
.
time
,
sign
,
hours
,
mins
);
(
unsigned
)
sig
->
when
.
time
,
sign
,
hours
,
mins
);
else
sig_buffer_len
=
snprintf
(
sig_buffer
,
sizeof
(
sig_buffer
),
"%s <%s> %u %c%02d%02d
\n
"
,
sig
->
name
,
sig
->
email
,
(
unsigned
)
sig
->
when
.
time
,
sign
,
hours
,
mins
);
if
(
sig_buffer_len
<
0
||
(
size_t
)
sig_buffer_len
>
sizeof
(
sig_buffer
))
if
(
sig_buffer_len
<
0
||
(
size_t
)
sig_buffer_len
>
sizeof
(
sig_buffer
))
return
GIT_ENOMEM
;
return
GIT_ENOMEM
;
...
...
src/tag.c
View file @
d483a911
...
@@ -227,7 +227,7 @@ int git_tag_create(
...
@@ -227,7 +227,7 @@ int git_tag_create(
}
}
type_str
=
git_object_type2string
(
git_object_type
(
target
));
type_str
=
git_object_type2string
(
git_object_type
(
target
));
tagger_str_len
=
git_signature__write
(
&
tagger_str
,
"tagger"
,
tagger
);
tagger_str_len
=
git_signature__write
(
&
tagger_str
,
"tagger
"
,
tagger
);
type_str_len
=
strlen
(
type_str
);
type_str_len
=
strlen
(
type_str
);
tag_name_len
=
strlen
(
tag_name
);
tag_name_len
=
strlen
(
tag_name
);
...
@@ -413,4 +413,4 @@ int git_tag_list_match(git_strarray *tag_names, const char *pattern, git_reposit
...
@@ -413,4 +413,4 @@ int git_tag_list_match(git_strarray *tag_names, const char *pattern, git_reposit
int
git_tag_list
(
git_strarray
*
tag_names
,
git_repository
*
repo
)
int
git_tag_list
(
git_strarray
*
tag_names
,
git_repository
*
repo
)
{
{
return
git_tag_list_match
(
tag_names
,
""
,
repo
);
return
git_tag_list_match
(
tag_names
,
""
,
repo
);
}
}
\ No newline at end of file
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