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

Update LibGit2Sharp library to 0.23.1 #2295

Merged
merged 1 commit into from Jan 19, 2017
Merged

Conversation

ahmelsayed
Copy link
Member

No description provided.

if (string.IsNullOrWhiteSpace(authorName) ||
string.IsNullOrWhiteSpace(emailAddress))
{
repo.Commit(message);
var emptyAuthor = new Signature(string.Empty, string.Empty, DateTimeOffset.UtcNow);
Copy link
Member Author

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.

Copy link
Member

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");
Copy link
Member Author

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?

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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?

Copy link
Member

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 })
Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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

@ahmelsayed ahmelsayed merged commit 55d89b7 into master Jan 19, 2017
@ahmelsayed ahmelsayed deleted the update-libgit2sharp branch July 14, 2017 04:09
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

Successfully merging this pull request may close these issues.

None yet

3 participants