Repository have several types of commits:
- Commits which are branch heads
- Commits which are tag reference
- Parents of commits from point 1, 2 and 3.
How can I properly find commit by a SHA number?
My current solution:
return (Commit)repo.ObjectDatabase
.First(o =>
o.GetType() == typeof(Commit) &&
o.Sha.Equals(shortSha, StringComparison.InvariantCultureIgnoreCase));
My current solution iterates by all git objects, and searching takes a while.
I think here must be a better way.