mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-11-16 08:38:26 +01:00
The changes module crashed on empty commit/revision lists (Fixes #68).
Once again introduced with aeb9ad6
, this could happen whenever a
repository had no commits or if the history was being filtered with
--since and/or --until and no commits were being detected within that
interval.
This commit is contained in:
parent
6d89cdf8c8
commit
e4827ee58e
1 changed files with 19 additions and 17 deletions
|
@ -185,12 +185,14 @@ class Changes:
|
|||
emails_by_author = {}
|
||||
|
||||
def __init__(self, hard):
|
||||
|
||||
self.commits = []
|
||||
git_log_hashes_r = subprocess.Popen(filter(None, ["git", "rev-list", "--reverse", "--no-merges",
|
||||
interval.get_since(), interval.get_until(), "HEAD"]), bufsize=1,
|
||||
stdout=subprocess.PIPE).stdout
|
||||
lines = git_log_hashes_r.readlines()
|
||||
git_log_hashes_r.close()
|
||||
|
||||
if len(lines) > 0:
|
||||
self.commits = [None] * (len(lines) // CHANGES_PER_THREAD + 1)
|
||||
first_hash = ""
|
||||
|
||||
|
@ -209,12 +211,12 @@ class Changes:
|
|||
for i in range(0, NUM_THREADS):
|
||||
__thread_lock__.acquire()
|
||||
|
||||
if len(self.commits) > 0:
|
||||
self.commits = [item for sublist in self.commits for item in sublist]
|
||||
|
||||
if interval.has_interval() and len(self.commits) > 0:
|
||||
interval.set_ref(self.commits[-1].sha)
|
||||
|
||||
if len(self.commits) > 0:
|
||||
self.first_commit_date = datetime.date(int(self.commits[0].date[0:4]), int(self.commits[0].date[5:7]),
|
||||
int(self.commits[0].date[8:10]))
|
||||
self.last_commit_date = datetime.date(int(self.commits[-1].date[0:4]), int(self.commits[-1].date[5:7]),
|
||||
|
|
Loading…
Reference in a new issue