Skip to content

Commit 2190a43

Browse files
committed
Merge branch 'js/blame-parsename'
* js/blame-parsename: t/annotate-tests: Use echo & cat instead of sed blame: tolerate bogus e-mail addresses a bit better
2 parents ace8ebb + c01bd5a commit 2190a43

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

builtin/blame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ static void get_ac_line(const char *inbuf, const char *what,
13781378
timepos = tmp;
13791379

13801380
*tmp = 0;
1381-
while (person < tmp && *tmp != ' ')
1381+
while (person < tmp && !(*tmp == ' ' && tmp[1] == '<'))
13821382
tmp--;
13831383
if (tmp <= person)
13841384
return;

t/annotate-tests.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file isn't used as a test script directly, instead it is
2-
# sourced from t8001-annotate.sh and t8001-blame.sh.
2+
# sourced from t8001-annotate.sh and t8002-blame.sh.
33

44
check_count () {
55
head=
@@ -124,3 +124,14 @@ test_expect_success \
124124
test_expect_success \
125125
'some edit' \
126126
'check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1'
127+
128+
test_expect_success \
129+
'an obfuscated email added' \
130+
'echo "No robots allowed" > file.new &&
131+
cat file >> file.new &&
132+
mv file.new file &&
133+
GIT_AUTHOR_NAME="E" GIT_AUTHOR_EMAIL="E at test dot git" git commit -a -m "norobots"'
134+
135+
test_expect_success \
136+
'obfuscated email parsed' \
137+
'check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1'

t/t8002-blame.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PROG='git blame -c'
88

99
PROG='git blame -c -e'
1010
test_expect_success 'Blame --show-email works' '
11-
11+
check_count "<[email protected]>" 1 "<[email protected]>" 1 "<[email protected]>" 1 "<[email protected]>" 1 "<[email protected]>" 1 "<[email protected]>" 1 "<[email protected]>" 1 "<E at test dot git>" 1
1212
'
1313

1414
test_done

0 commit comments

Comments
 (0)