Skip to content

Commit f651a9e

Browse files
author
Nelson Vides
committed
Removed comments, clarify changes. Working out libgit2sharp v0.24
1 parent d7fc5ef commit f651a9e

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

Rubberduck.SourceControl/GitProvider.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ public override IRepository InitVBAProject(string directory)
185185
var status = repo.RetrieveStatus(new StatusOptions {DetectRenamesInWorkDir = true});
186186
foreach (var stat in status.Untracked)
187187
{
188-
// repo.Stage(stat.FilePath); //deprecated from LibGit2Sharp v0.24
189188
LibGit2Sharp.Commands.Stage(repo, stat.FilePath);
190189
}
191190

@@ -247,13 +246,7 @@ public override void Fetch([Optional] string remoteName)
247246

248247
if (remote != null)
249248
{
250-
//_repo.Network.Fetch(remote); // deprecated on LibGit2Sharp from v0.24.0
251-
/*
252-
* The new functionality requires a refSpec.
253-
* As I suppose we're just tracking by default the whole remote,
254-
* then I choose to hardcode the refSpec here:
255-
*/
256-
// NOTE: hardcoded string
249+
// FIXME: hardcoded string
257250
IEnumerable<string> refSpec = new List<string>() {"+refs/heads/*:refs/remotes/origin/*"};
258251
LibGit2Sharp.Commands.Fetch(_repo, remoteName, refSpec, null,"");
259252
}
@@ -279,7 +272,6 @@ public override void Pull()
279272
};
280273

281274
var signature = GetSignature();
282-
//_repo.Network.Pull(signature, options); // deprecated on LibGit2Sharp from v0.24.0
283275
LibGit2Sharp.Commands.Pull(_repo, signature, options);
284276

285277
base.Pull();
@@ -311,7 +303,6 @@ public override void Stage(string filePath)
311303
{
312304
try
313305
{
314-
// _repo.Stage(filePath); // deprecated on LibGit2Sharp from v0.24.0
315306
LibGit2Sharp.Commands.Stage(_repo, filePath);
316307
}
317308
catch (LibGit2SharpException ex)
@@ -324,7 +315,6 @@ public override void Stage(IEnumerable<string> filePaths)
324315
{
325316
try
326317
{
327-
//_repo.Stage(filePaths); // deprecated on LibGit2Sharp from v0.24.0
328318
LibGit2Sharp.Commands.Stage(_repo, filePaths);
329319
}
330320
catch (LibGit2SharpException ex)
@@ -360,7 +350,6 @@ public override void Checkout(string branch)
360350
{
361351
try
362352
{
363-
//_repo.Checkout(_repo.Branches[branch]); // deprecated on LibGit2Sharp from v0.24.0
364353
LibGit2Sharp.Commands.Checkout(_repo, branch);
365354
base.Checkout(branch);
366355

@@ -377,7 +366,6 @@ public override void CreateBranch(string branch)
377366
try
378367
{
379368
_repo.CreateBranch(branch);
380-
//_repo.Checkout(branch); // deprecated on LibGit2Sharp from v0.24.0
381369
LibGit2Sharp.Commands.Checkout(_repo,branch);
382370

383371
RequeryUnsyncedCommits();
@@ -393,7 +381,6 @@ public override void CreateBranch(string sourceBranch, string branch)
393381
try
394382
{
395383
_repo.CreateBranch(branch, _repo.Branches[sourceBranch].Commits.Last());
396-
//_repo.Checkout(branch); // deprecated on LibGit2Sharp from v0.24.0
397384
LibGit2Sharp.Commands.Checkout(_repo, branch);
398385

399386
RequeryUnsyncedCommits();
@@ -432,7 +419,6 @@ public override void Unpublish(string branch)
432419
{
433420
try
434421
{
435-
//var remote = _repo.Branches[branch].Remote; // deprecated on LibGit2Sharp from v0.24.0
436422
var remote = _repo.Network.Remotes[branch];
437423

438424
_repo.Branches.Update(_repo.Branches[branch], b => b.Remote = remote.Name,
@@ -498,7 +484,6 @@ public override void RemoveFile(string filePath, bool removeFromWorkingDirectory
498484
try
499485
{
500486
NotifyExternalFileChanges = false;
501-
//_repo.Remove(filePath, removeFromWorkingDirectory); // deprecated on LibGit2Sharp from v0.24.0
502487
LibGit2Sharp.Commands.Remove(_repo, filePath, removeFromWorkingDirectory);
503488
NotifyExternalFileChanges = true;
504489
}
@@ -572,7 +557,6 @@ public override void DeleteBranch(string branchName)
572557
};
573558
}
574559

575-
//_repo.Network.Push(branch.Remote, ":" + _repo.Branches[branchName].UpstreamBranchCanonicalName, options); // deprecated on LibGit2Sharp from v0.24.0
576560
_repo.Network.Push(_repo.Network.Remotes[branchName], ":" + _repo.Branches[branchName].UpstreamBranchCanonicalName, options);
577561
}
578562

Rubberduck.SourceControl/Rubberduck.SourceControl.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props" Condition="Exists('..\packages\LibGit2Sharp.0.22.0-pre20150516171636\build\net40\LibGit2Sharp.props')" />
43
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
54
<PropertyGroup>
65
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -40,6 +39,7 @@
4039
<ItemGroup>
4140
<Reference Include="LibGit2Sharp, Version=0.24.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
4241
<SpecificVersion>False</SpecificVersion>
42+
<private>True</private>
4343
<HintPath>..\packages\LibGit2Sharp.0.24.0\lib\net40\LibGit2Sharp.dll</HintPath>
4444
</Reference>
4545
<Reference Include="Microsoft.Vbe.Interop, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
@@ -108,7 +108,6 @@
108108
<PropertyGroup>
109109
<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>
110110
</PropertyGroup>
111-
<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'))" />
112111
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
113112
</Target>
114113
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />

0 commit comments

Comments
 (0)