Skip to content

Commit 69eb654

Browse files
authored
Merge pull request tobami#243 from theLastOfCats/git-getlogs-trimming
Added triming for `git-log` and `git-tag`.
2 parents 784bdfc + 3108448 commit 69eb654

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

codespeed/commits/git.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from subprocess import Popen, PIPE
21
import datetime
3-
import os
42
import logging
3+
import os
4+
from string import strip
5+
from subprocess import Popen, PIPE
56

67
from django.conf import settings
78

@@ -64,7 +65,7 @@ def getlogs(endrev, startrev):
6465
logs = []
6566
for log in filter(None, stdout.split(b'\x1e')):
6667
(short_commit_id, commit_id, date_t, author_name, author_email,
67-
subject, body) = log.split(b'\x00', 7)
68+
subject, body) = map(strip, log.split(b'\x00', 7))
6869

6970
tag = ""
7071

@@ -78,7 +79,7 @@ def getlogs(endrev, startrev):
7879
stderr = b''
7980

8081
if proc.returncode == 0:
81-
tag = stdout
82+
tag = stdout.strip()
8283

8384
date = datetime.datetime.fromtimestamp(
8485
int(date_t)).strftime("%Y-%m-%d %H:%M:%S")

0 commit comments

Comments
 (0)