Skip to content

Commit

Permalink
Merge pull request gitpython-developers#1501 from SergeantMenacingGar…
Browse files Browse the repository at this point in the history
…lic/date_types

Add datetime.datetime type to commit_date and author_date
  • Loading branch information
Byron authored Oct 14, 2022
2 parents 19aaa74 + 8f51abd commit 183cf35
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 183cf35

Please sign in to comment.