From f651a9ed074a6539750f4151635ec67e5a06f5bd Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Tue, 21 Nov 2017 09:37:03 +0100 Subject: [PATCH] Removed comments, clarify changes. Working out libgit2sharp v0.24 --- Rubberduck.SourceControl/GitProvider.cs | 18 +----------------- .../Rubberduck.SourceControl.csproj | 3 +-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/Rubberduck.SourceControl/GitProvider.cs b/Rubberduck.SourceControl/GitProvider.cs index 5d1f01f89f..7e3c89d98e 100644 --- a/Rubberduck.SourceControl/GitProvider.cs +++ b/Rubberduck.SourceControl/GitProvider.cs @@ -185,7 +185,6 @@ public override IRepository InitVBAProject(string directory) var status = repo.RetrieveStatus(new StatusOptions {DetectRenamesInWorkDir = true}); foreach (var stat in status.Untracked) { - // repo.Stage(stat.FilePath); //deprecated from LibGit2Sharp v0.24 LibGit2Sharp.Commands.Stage(repo, stat.FilePath); } @@ -247,13 +246,7 @@ public override void Fetch([Optional] string remoteName) if (remote != null) { - //_repo.Network.Fetch(remote); // deprecated on LibGit2Sharp from v0.24.0 - /* - * The new functionality requires a refSpec. - * As I suppose we're just tracking by default the whole remote, - * then I choose to hardcode the refSpec here: - */ - // NOTE: hardcoded string + // FIXME: hardcoded string IEnumerable refSpec = new List() {"+refs/heads/*:refs/remotes/origin/*"}; LibGit2Sharp.Commands.Fetch(_repo, remoteName, refSpec, null,""); } @@ -279,7 +272,6 @@ public override void Pull() }; var signature = GetSignature(); - //_repo.Network.Pull(signature, options); // deprecated on LibGit2Sharp from v0.24.0 LibGit2Sharp.Commands.Pull(_repo, signature, options); base.Pull(); @@ -311,7 +303,6 @@ public override void Stage(string filePath) { try { - // _repo.Stage(filePath); // deprecated on LibGit2Sharp from v0.24.0 LibGit2Sharp.Commands.Stage(_repo, filePath); } catch (LibGit2SharpException ex) @@ -324,7 +315,6 @@ public override void Stage(IEnumerable filePaths) { try { - //_repo.Stage(filePaths); // deprecated on LibGit2Sharp from v0.24.0 LibGit2Sharp.Commands.Stage(_repo, filePaths); } catch (LibGit2SharpException ex) @@ -360,7 +350,6 @@ public override void Checkout(string branch) { try { - //_repo.Checkout(_repo.Branches[branch]); // deprecated on LibGit2Sharp from v0.24.0 LibGit2Sharp.Commands.Checkout(_repo, branch); base.Checkout(branch); @@ -377,7 +366,6 @@ public override void CreateBranch(string branch) try { _repo.CreateBranch(branch); - //_repo.Checkout(branch); // deprecated on LibGit2Sharp from v0.24.0 LibGit2Sharp.Commands.Checkout(_repo,branch); RequeryUnsyncedCommits(); @@ -393,7 +381,6 @@ public override void CreateBranch(string sourceBranch, string branch) try { _repo.CreateBranch(branch, _repo.Branches[sourceBranch].Commits.Last()); - //_repo.Checkout(branch); // deprecated on LibGit2Sharp from v0.24.0 LibGit2Sharp.Commands.Checkout(_repo, branch); RequeryUnsyncedCommits(); @@ -432,7 +419,6 @@ public override void Unpublish(string branch) { try { - //var remote = _repo.Branches[branch].Remote; // deprecated on LibGit2Sharp from v0.24.0 var remote = _repo.Network.Remotes[branch]; _repo.Branches.Update(_repo.Branches[branch], b => b.Remote = remote.Name, @@ -498,7 +484,6 @@ public override void RemoveFile(string filePath, bool removeFromWorkingDirectory try { NotifyExternalFileChanges = false; - //_repo.Remove(filePath, removeFromWorkingDirectory); // deprecated on LibGit2Sharp from v0.24.0 LibGit2Sharp.Commands.Remove(_repo, filePath, removeFromWorkingDirectory); NotifyExternalFileChanges = true; } @@ -572,7 +557,6 @@ public override void DeleteBranch(string branchName) }; } - //_repo.Network.Push(branch.Remote, ":" + _repo.Branches[branchName].UpstreamBranchCanonicalName, options); // deprecated on LibGit2Sharp from v0.24.0 _repo.Network.Push(_repo.Network.Remotes[branchName], ":" + _repo.Branches[branchName].UpstreamBranchCanonicalName, options); } diff --git a/Rubberduck.SourceControl/Rubberduck.SourceControl.csproj b/Rubberduck.SourceControl/Rubberduck.SourceControl.csproj index 1cc499c4c5..aa6126e944 100644 --- a/Rubberduck.SourceControl/Rubberduck.SourceControl.csproj +++ b/Rubberduck.SourceControl/Rubberduck.SourceControl.csproj @@ -1,6 +1,5 @@  - Debug @@ -40,6 +39,7 @@ False + True ..\packages\LibGit2Sharp.0.24.0\lib\net40\LibGit2Sharp.dll @@ -108,7 +108,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. -