Skip to content

Commit 72d26f7

Browse files
committed
Update the specs pelican plugin for compatibility with recent python-git
1 parent e085be4 commit 72d26f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/plugins/specs/specs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ def specs(content):
4848
content.updated = time.gmtime(os.stat(path).st_mtime)
4949
content.gitrev = '(not yet committed)'
5050
else:
51-
commits = repo.commits(path=path)
52-
assert len(commits) > 0
53-
content.updated = commits[0].committed_date
54-
content.gitrev = commits[0].id
51+
commits = repo.iter_commits(paths=path)
52+
commit = commits.next()
53+
content.updated = datetime.fromtimestamp(commit.committed_date).timetuple()
54+
content.gitrev = commit.hexsha
5555

5656
content.updated = time.strftime('%F %T UTC (%a, %d %B %Y)', content.updated)
5757

0 commit comments

Comments
 (0)