Skip to content
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

CommitLog order does not reflect order of commits. #2100

Open
TimScholtens opened this issue Jun 4, 2024 · 0 comments
Open

CommitLog order does not reflect order of commits. #2100

TimScholtens opened this issue Jun 4, 2024 · 0 comments

Comments

@TimScholtens
Copy link

Hi!

I am currently working on an E2E test which involves creating many commits, I am running into some issues however.
The repository's commit log order is different compared to the order of commits I have made.

Reproduction steps

public LibGitRepositoryBuilder WithManyCommits(int numberOfCommits, string commitMessage)
{
    for (int i = 0; i < numberOfCommits; i++)
    {
        // Create & stage file.
        var filePath = Path.Combine(_repoPath, $"{Guid.NewGuid()}.txt");
        File.Create(filePath).Dispose();

        var relativeFilePathToRoot = Path.GetRelativePath(_repository.Info.WorkingDirectory, filePath);
        Commands.Stage(_repository, relativeFilePathToRoot);
        _repository.Commit($"{commitMessage}-{i}", new Signature("bot", "[email protected]", DateTimeOffset.UtcNow), new Signature("bot", "[email protected]", DateTimeOffset.UtcNow));
    }

    return this;
}
var repo = new LibGitRepositoryBuilder(path)
    .WithManyCommits(100, "Hello world")
    .Build();

Expected behavior

  • "Hello world-99"
  • "Hello world-98"
  • "Hello world-97"
  • ....

Actual behavior

CommitsLog incorrect order

Version of LibGit2Sharp (release number or SHA1)

0.30.0

Operating system(s) tested; .NET runtime tested

OS
Edition Windows 11 Pro for Workstations
Version 23H2
Installed on ‎22/‎02/‎2024
OS build 22631.3593
Experience Windows Feature Experience Pack 1000.22700.1003.0

.NET
.NET 8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant