Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added parsing for '@1400000000 +0000' date format as used by git commit hooks#965

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall 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
1 change: 1 addition & 0 deletionsAUTHORS
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,5 +37,6 @@ Contributors are:
-Anil Khatri <anil.soccer.khatri _at_ gmail.com>
-JJ Graham <thetwoj _at_ gmail.com>
-Ben Thayer <ben _at_ benthayer.com>
-Dries Kennes <admin _at_ dries007.net>

Portions derived from other open source works and are clearly marked.
2 changes: 2 additions & 0 deletionsgit/objects/util.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,6 +148,8 @@ def parse_date(string_date):
try:
if string_date.count(' ') == 1 and string_date.rfind(':') == -1:
timestamp, offset = string_date.split()
if timestamp.startswith('@'):
timestamp = timestamp[1:]
timestamp = int(timestamp)
return timestamp, utctz_to_altz(verify_utctz(offset))
else:
Expand Down
6 changes: 6 additions & 0 deletionsgit/test/test_repo.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -220,6 +220,12 @@ def test_clone_from_keeps_env(self, rw_dir):

assert_equal(environment, cloned.git.environment())

@with_rw_directory
def test_date_format(self, rw_dir):
repo = Repo.init(osp.join(rw_dir, "repo"))
# @-timestamp is the format used by git commit hooks
repo.index.commit("Commit messages", commit_date="@1400000000 +0000")

@with_rw_directory
def test_clone_from_pathlib(self, rw_dir):
if pathlib is None: # pythons bellow 3.4 don't have pathlib
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp