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
82d44145
Commit
82d44145
authored
Dec 14, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pr/6657' into main
parents
2d744e9c
85c4edfa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
src/libgit2/signature.c
+0
-1
tests/libgit2/commit/signature.c
+8
-1
No files found.
src/libgit2/signature.c
View file @
82d44145
...
@@ -43,7 +43,6 @@ static bool contains_angle_brackets(const char *input)
...
@@ -43,7 +43,6 @@ static bool contains_angle_brackets(const char *input)
static
bool
is_crud
(
unsigned
char
c
)
static
bool
is_crud
(
unsigned
char
c
)
{
{
return
c
<=
32
||
return
c
<=
32
||
c
==
'.'
||
c
==
','
||
c
==
','
||
c
==
':'
||
c
==
':'
||
c
==
';'
||
c
==
';'
||
...
...
tests/libgit2/commit/signature.c
View file @
82d44145
...
@@ -36,10 +36,17 @@ void test_commit_signature__leading_and_trailing_spaces_are_trimmed(void)
...
@@ -36,10 +36,17 @@ void test_commit_signature__leading_and_trailing_spaces_are_trimmed(void)
assert_name_and_email
(
"nulltoken"
,
"emeric.fermas@gmail.com"
,
"
\t
nulltoken
\n
"
,
"
\n
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__leading_and_trailing_dots_are_supported
(
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."
);
assert_name_and_email
(
".nulltoken."
,
".emeric.fermas@gmail.com."
,
".nulltoken."
,
".emeric.fermas@gmail.com."
);
}
void
test_commit_signature__leading_and_trailing_crud_is_trimmed
(
void
)
void
test_commit_signature__leading_and_trailing_crud_is_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
\"
"
);
assert_name_and_email
(
"nulltoken w"
,
"emeric.fermas@gmail.com"
,
"nulltoken w
.
"
,
"emeric.fermas@gmail.com"
);
assert_name_and_email
(
"nulltoken w"
,
"emeric.fermas@gmail.com"
,
"nulltoken w
;
"
,
"emeric.fermas@gmail.com"
);
assert_name_and_email
(
"nulltoken
\xe2\x98\xba
"
,
"emeric.fermas@gmail.com"
,
"nulltoken
\xe2\x98\xba
"
,
"emeric.fermas@gmail.com"
);
assert_name_and_email
(
"nulltoken
\xe2\x98\xba
"
,
"emeric.fermas@gmail.com"
,
"nulltoken
\xe2\x98\xba
"
,
"emeric.fermas@gmail.com"
);
}
}
...
...
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