Skip to content

Commit 8f51abd

Browse files
Add datetime.datetime type to commit_date and author_date
1 parent 19aaa74 commit 8f51abd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: git/index/base.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7+
import datetime
78
import glob
89
from io import BytesIO
910
import os
@@ -1032,8 +1033,8 @@ def commit(
10321033
head: bool = True,
10331034
author: Union[None, "Actor"] = None,
10341035
committer: Union[None, "Actor"] = None,
1035-
author_date: Union[str, None] = None,
1036-
commit_date: Union[str, None] = None,
1036+
author_date: Union[datetime.datetime, str, None] = None,
1037+
commit_date: Union[datetime.datetime, str, None] = None,
10371038
skip_hooks: bool = False,
10381039
) -> Commit:
10391040
"""Commit the current default index file, creating a commit object.

Diff for: git/objects/commit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ def create_from_tree(
435435
head: bool = False,
436436
author: Union[None, Actor] = None,
437437
committer: Union[None, Actor] = None,
438-
author_date: Union[None, str] = None,
439-
commit_date: Union[None, str] = None,
438+
author_date: Union[None, str, datetime.datetime] = None,
439+
commit_date: Union[None, str, datetime.datetime] = None,
440440
) -> "Commit":
441441
"""Commit the given tree, creating a commit object.
442442

0 commit comments

Comments
 (0)