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

Commitf7cff58

Browse files
dries007Byron
authored andcommitted
Added parsing for '@1400000000 +0000' date format as used by git commit hooks.
1 parent313b3b4 commitf7cff58

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

‎AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ Contributors are:
3737
-Anil Khatri <anil.soccer.khatri _at_ gmail.com>
3838
-JJ Graham <thetwoj _at_ gmail.com>
3939
-Ben Thayer <ben _at_ benthayer.com>
40+
-Dries Kennes <admin _at_ dries007.net>
4041

4142
Portions derived from other open source works and are clearly marked.

‎git/objects/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ def parse_date(string_date):
148148
try:
149149
ifstring_date.count(' ')==1andstring_date.rfind(':')==-1:
150150
timestamp,offset=string_date.split()
151+
iftimestamp.startswith('@'):
152+
timestamp=timestamp[1:]
151153
timestamp=int(timestamp)
152154
returntimestamp,utctz_to_altz(verify_utctz(offset))
153155
else:

‎git/test/test_repo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ def test_clone_from_keeps_env(self, rw_dir):
220220

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

223+
@with_rw_directory
224+
deftest_date_format(self,rw_dir):
225+
repo=Repo.init(osp.join(rw_dir,"repo"))
226+
# @-timestamp is the format used by git commit hooks
227+
repo.index.commit("Commit messages",commit_date="@1400000000 +0000")
228+
223229
@with_rw_directory
224230
deftest_clone_from_pathlib(self,rw_dir):
225231
ifpathlibisNone:# pythons bellow 3.4 don't have pathlib

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp