Skip to content

Commit cf07e53

Browse files
committed
Merge branch 'bc/ident-dot-is-no-longer-crud-letter'
Exclude "." from the set of characters to be removed from the beginning and the end of the human-readable name. * bc/ident-dot-is-no-longer-crud-letter: ident: don't consider '.' a crud
2 parents 889c94d + 1c04cb0 commit cf07e53

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

ident.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ void reset_ident_date(void)
203203
static int crud(unsigned char c)
204204
{
205205
return c <= 32 ||
206-
c == '.' ||
207206
c == ',' ||
208207
c == ':' ||
209208
c == ';' ||

t/t4203-mailmap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ test_expect_success 'gitmailmap(5) example output: example #1' '
466466
Author Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@laptop.(none)>
467467
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
468468
469-
Author Jane D <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>
469+
Author Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>
470470
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
471471
EOF
472472
git -C doc log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
@@ -494,7 +494,7 @@ test_expect_success 'gitmailmap(5) example output: example #2' '
494494
Author Jane Doe <jane@laptop.(none)> maps to Jane Doe <[email protected]>
495495
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
496496
497-
Author Jane D <jane@desktop.(none)> maps to Jane Doe <[email protected]>
497+
Author Jane D. <jane@desktop.(none)> maps to Jane Doe <[email protected]>
498498
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
499499
EOF
500500
git -C doc log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&

t/t7518-ident-corner-cases.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,19 @@ test_expect_success 'empty name and missing email' '
2020
'
2121

2222
test_expect_success 'commit rejects all-crud name' '
23-
test_must_fail env GIT_AUTHOR_NAME=" .;<>" \
23+
test_must_fail env GIT_AUTHOR_NAME=" ,;<>" \
2424
git commit --allow-empty -m foo
2525
'
2626

27+
test_expect_success 'commit does not strip trailing dot' '
28+
author_name="Pat Doe Jr." &&
29+
env GIT_AUTHOR_NAME="$author_name" \
30+
git commit --allow-empty -m foo &&
31+
git log -1 --format=%an >actual &&
32+
echo "$author_name" >expected &&
33+
test_cmp actual expected
34+
'
35+
2736
# We must test the actual error message here, as an unwanted
2837
# auto-detection could fail for other reasons.
2938
test_expect_success 'empty configured name does not auto-detect' '

0 commit comments

Comments
 (0)