Skip to content

Commit 4391dce

Browse files
committed
Fix bug in getting creation date commit when there is no history
1 parent ebcabae commit 4391dce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mkdocs_git_revision_date_localized_plugin/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def get_git_commit_timestamp(
112112
# A file can be created multiple times, through a file renamed.
113113
# Commits are ordered with most recent commit first
114114
# Get the oldest commit only
115-
commit_timestamp = commit_timestamp.split()[-1]
115+
if commit_timestamp != "":
116+
commit_timestamp = commit_timestamp.split()[-1]
116117
else:
117118
commit_timestamp = git.log(
118119
realpath, date="short", format="%at", n=1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="mkdocs-git-revision-date-localized-plugin",
15-
version="0.9.1",
15+
version="0.9.2",
1616
description="Mkdocs plugin that enables displaying the localized date of the last git modification of a markdown file.",
1717
long_description=LONG_DESCRIPTION,
1818
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)