Skip to content

Add datetime.datetime type to commit_date and author_date #1501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions git/index/base.py
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions git/objects/commit.py
Original file line number Diff line number Diff line change
@@ -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.