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
Update LibGit2Sharp library to 0.23.1 #2295
Conversation
if (string.IsNullOrWhiteSpace(authorName) || | ||
string.IsNullOrWhiteSpace(emailAddress)) | ||
{ | ||
repo.Commit(message); | ||
var emptyAuthor = new Signature(string.Empty, string.Empty, DateTimeOffset.UtcNow); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit()
now requires author and committer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be slightly cleaner to just set those vars to empty if they're null, and use single code path.
@@ -225,7 +227,7 @@ public void FetchWithoutConflict(string remoteUrl, string branchName) | |||
using (tracer.Step("LibGit2SharpRepository Fetch")) | |||
{ | |||
// This will only retrieve the "master" | |||
repo.Network.Fetch(remote); | |||
LibGit2Sharp.Commands.Fetch(repo, remote.Name, remote.RefSpecs.Select(r => r.Specification), new FetchOptions(), "LibGit2SharpRepository Fetch"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change I'm actually not sure of. I don't know what the equivalent for the IEnumerable<string> refSpecs
is. I thought it might be Specification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems awfully complicated to do a simple fetch. Doc still claims that simple one works: https://github.com/libgit2/libgit2sharp/wiki/git-fetch. Maybe worth opening issue to ask clarification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compilation actually fails with API Obsolete error
https://github.com/libgit2/libgit2sharp/blob/master/LibGit2Sharp/Network.cs#L149-L153
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't heard back on this. I'm thinking we could just run all the tests we got and if they all pass, merge it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that seems fair.
@@ -354,7 +356,7 @@ public IEnumerable<string> ListFiles(string path, SearchOption searchOption, par | |||
|
|||
using (var repo = new LibGit2Sharp.Repository(RepositoryPath)) | |||
{ | |||
var files = repo.Diff.Compare<TreeChanges>(null, DiffTargets.Index, lookupList, compareOptions: new CompareOptions() { IncludeUnmodified = true, Similarity = SimilarityOptions.None }) | |||
var files = repo.Diff.Compare<TreeChanges>(null, DiffTargets.Index, lookupList, new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false }, compareOptions: new CompareOptions() { IncludeUnmodified = true, Similarity = SimilarityOptions.None }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what ExplicitPathsOptions
, can't seem to find any docs for it. most the wikis on their repo are outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea what that means. :( What Kudu scenario uses list files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for searching for any files in the repo for type discovery. We use git ls-files instead of a normal Directory.GetFiles()
because of performance impact when we have a massive node_modules folder. using git ls-files is much faster since git is aware of what is in and not in the repo itself
57b64d9
to
dcce51b
Compare
dcce51b
to
55d89b7
Compare
No description provided.