Skip to content
Permalink
Browse files

Removed comments, clarify changes. Working out libgit2sharp v0.24

  • Loading branch information...
Nelson Vides
Nelson Vides committed Nov 21, 2017
1 parent d7fc5ef commit f651a9ed074a6539750f4151635ec67e5a06f5bd
@@ -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<string> refSpec = new List<string>() {"+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<string> 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);
}

@@ -1,6 +1,5 @@
<?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="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -40,6 +39,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">
@@ -108,7 +108,6 @@
<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('$(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')" />

0 comments on commit f651a9e

Please sign in to comment.
You can’t perform that action at this time.