Skip to content

Commit

Permalink
Add datetime.datetime type to commit_date and author_date
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeantMenacingGarlic committed Oct 13, 2022
1 parent 19aaa74 commit 8f51abd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions git/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions git/objects/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8f51abd

Please sign in to comment.