diff --git a/git/index/base.py b/git/index/base.py index 10f8b8b25..17d18db58 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -4,6 +4,7 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php +import datetime import glob from io import BytesIO import os @@ -1032,8 +1033,8 @@ def commit( head: bool = True, author: Union[None, "Actor"] = None, committer: Union[None, "Actor"] = None, - author_date: Union[str, None] = None, - commit_date: Union[str, None] = None, + author_date: Union[datetime.datetime, str, None] = None, + commit_date: Union[datetime.datetime, str, None] = None, skip_hooks: bool = False, ) -> Commit: """Commit the current default index file, creating a commit object. diff --git a/git/objects/commit.py b/git/objects/commit.py index cf7d9aaa2..82d2387b3 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -435,8 +435,8 @@ def create_from_tree( head: bool = False, author: Union[None, Actor] = None, committer: Union[None, Actor] = None, - author_date: Union[None, str] = None, - commit_date: Union[None, str] = None, + author_date: Union[None, str, datetime.datetime] = None, + commit_date: Union[None, str, datetime.datetime] = None, ) -> "Commit": """Commit the given tree, creating a commit object.