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
9d4db41a
Commit
9d4db41a
authored
Jun 11, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1644 from carlosmn/sig-isspace
signature: extend trimming to more whitespace
parents
3de768ca
24ec6999
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
src/signature.c
+2
-2
tests-clar/commit/signature.c
+2
-0
No files found.
src/signature.c
View file @
9d4db41a
...
...
@@ -35,11 +35,11 @@ static bool contains_angle_brackets(const char *input)
static
char
*
extract_trimmed
(
const
char
*
ptr
,
size_t
len
)
{
while
(
len
&&
ptr
[
0
]
==
' '
)
{
while
(
len
&&
git__isspace
(
ptr
[
0
])
)
{
ptr
++
;
len
--
;
}
while
(
len
&&
ptr
[
len
-
1
]
==
' '
)
{
while
(
len
&&
git__isspace
(
ptr
[
len
-
1
])
)
{
len
--
;
}
...
...
tests-clar/commit/signature.c
View file @
9d4db41a
...
...
@@ -31,6 +31,8 @@ static void assert_name_and_email(
void
test_commit_signature__leading_and_trailing_spaces_are_trimmed
(
void
)
{
assert_name_and_email
(
"nulltoken"
,
"emeric.fermas@gmail.com"
,
" nulltoken "
,
" emeric.fermas@gmail.com "
);
assert_name_and_email
(
"nulltoken"
,
"emeric.fermas@gmail.com"
,
" nulltoken "
,
" emeric.fermas@gmail.com
\n
"
);
assert_name_and_email
(
"nulltoken"
,
"emeric.fermas@gmail.com"
,
"
\t
nulltoken
\n
"
,
"
\n
emeric.fermas@gmail.com
\n
"
);
}
void
test_commit_signature__angle_brackets_in_names_are_not_supported
(
void
)
...
...
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