Skip to content

Commit

Permalink
Removed comments, clarify changes. Working out libgit2sharp v0.24
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson Vides committed Nov 21, 2017
1 parent d7fc5ef commit 39c0e17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
2 changes: 0 additions & 2 deletions RetailCoder.VBE/Rubberduck.csproj
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.185\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.185\build\LibGit2Sharp.NativeBinaries.props')" />
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -1487,7 +1486,6 @@
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.185\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.185\build\LibGit2Sharp.NativeBinaries.props'))" />
</Target>
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
<PropertyGroup>
Expand Down
18 changes: 1 addition & 17 deletions Rubberduck.SourceControl/GitProvider.cs
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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<string> refSpec = new List<string>() {"+refs/heads/*:refs/remotes/origin/*"};
LibGit2Sharp.Commands.Fetch(_repo, remoteName, refSpec, null,"");
}
Expand All @@ -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();
Expand Down Expand Up @@ -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)
Expand All @@ -324,7 +315,6 @@ public override void Stage(IEnumerable<string> filePaths)
{
try
{
//_repo.Stage(filePaths); // deprecated on LibGit2Sharp from v0.24.0
LibGit2Sharp.Commands.Stage(_repo, filePaths);
}
catch (LibGit2SharpException ex)
Expand Down Expand Up @@ -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);

Expand All @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}

Expand Down
5 changes: 3 additions & 2 deletions Rubberduck.SourceControl/Rubberduck.SourceControl.csproj
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props" Condition="Exists('..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props')" />
<!--<Import Project="..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props" Condition="Exists('..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props')" />-->
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -40,6 +40,7 @@
<ItemGroup>
<Reference Include="LibGit2Sharp, Version=0.24.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<private>True</private>
<HintPath>..\packages\LibGit2Sharp.0.24.0\lib\net40\LibGit2Sharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Vbe.Interop, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
Expand Down Expand Up @@ -108,7 +109,7 @@
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props'))" />
<!--<Error Condition="!Exists('..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props'))" />-->
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
Expand Down

0 comments on commit 39c0e17

Please sign in to comment.