libgit2 / libgit2/libgit2sharp

Commits date wrong when date is prior to 01/01/1970

Open
#1,707 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

When creating a commit with a signature dated before 01/01/1970,
even if the signature is correct, the commit gets a wrong date.

(If intended, is there a work-around ?)

Reproduction steps

var author = Signature(author_name, author_email, author_date)

var last_commit = repo.Commit(message, author, author)

Expected behavior

author.When == last_commit.Author.When

Actual behavior

if author_date < 01/01/1970
author.When != last_commit.Author.When

Version of LibGit2Sharp (release number or SHA1)

libgit2sharp 0.26.0

Operating system(s) tested; .NET runtime tested

dotnet 2.2.401 on Ubuntu 18.04.3 LTS

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue from the Signature and Commit calls in the report with an author date before 01/01/1970 on .NET 2.2.401 and Ubuntu 18.04.3. Trace how the commit author date is serialized and read back, then verify that author.When equals last_commit.Author.When for pre-epoch dates.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.