diff --git a/AUTHORS b/AUTHORS index a6212c2f6..04e4bb0db 100644 --- a/AUTHORS +++ b/AUTHORS @@ -37,5 +37,6 @@ Contributors are: -Anil Khatri -JJ Graham -Ben Thayer +-Dries Kennes Portions derived from other open source works and are clearly marked. diff --git a/git/objects/util.py b/git/objects/util.py index 5dbd98224..235b520e9 100644 --- a/git/objects/util.py +++ b/git/objects/util.py @@ -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: diff --git a/git/test/test_repo.py b/git/test/test_repo.py index c59203ed6..ef28c74ec 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -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