Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Obsolete IsEmpty property on RepositoryInformation

  • Loading branch information...
commit 1f301ab2c02dd214a4cfe1eb5529bc81082fe62c 1 parent 813be8d
@jamill jamill authored nulltoken committed
View
2  LibGit2Sharp.Tests/CommitFixture.cs
@@ -618,7 +618,7 @@ public void CanCommitALittleBit()
AssertBlobContent(commit[relativeFilepath], "nulltoken\n");
Assert.Equal(0, commit.Parents.Count());
- Assert.False(repo.Info.IsEmpty);
+ Assert.False(repo.Info.IsHeadOrphaned);
File.WriteAllText(filePath, "nulltoken commits!\n");
repo.Index.Stage(relativeFilepath);
View
2  LibGit2Sharp.Tests/RepositoryFixture.cs
@@ -150,7 +150,6 @@ public void CreatingRepoWithBadParamsThrows()
private static void AssertInitializedRepository(Repository repo)
{
Assert.NotNull(repo.Info.Path);
- Assert.True(repo.Info.IsEmpty);
Assert.False(repo.Info.IsHeadDetached);
Assert.True(repo.Info.IsHeadOrphaned);
@@ -215,7 +214,6 @@ public void CanOpenRepository()
Assert.NotNull(repo.Info.Path);
Assert.Null(repo.Info.WorkingDirectory);
Assert.True(repo.Info.IsBare);
- Assert.False(repo.Info.IsEmpty);
Assert.False(repo.Info.IsHeadDetached);
}
}
View
2  LibGit2Sharp.Tests/TagFixture.cs
@@ -603,7 +603,7 @@ public void CanListAllTagsInAEmptyRepository()
using (var repo = Repository.Init(scd.DirectoryPath))
{
- Assert.True(repo.Info.IsEmpty);
+ Assert.True(repo.Info.IsHeadOrphaned);
Assert.Equal(0, repo.Tags.Count());
}
}
View
2  LibGit2Sharp/Repository.cs
@@ -673,7 +673,7 @@ public void Reset(Commit commit, IEnumerable<string> paths = null)
/// <returns>The generated <see cref = "Commit" />.</returns>
public Commit Commit(string message, Signature author, Signature committer, bool amendPreviousCommit = false)
{
- if (amendPreviousCommit && Info.IsEmpty)
+ if (amendPreviousCommit && Info.IsHeadOrphaned)
{
throw new LibGit2SharpException("Can not amend anything. The Head doesn't point at any commit.");
}
View
4 LibGit2Sharp/RepositoryInformation.cs
@@ -1,4 +1,5 @@
-using LibGit2Sharp.Core;
+using System;
+using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
@@ -51,6 +52,7 @@ internal RepositoryInformation(Repository repo, bool isBare)
/// <value>
/// <c>true</c> if this repository is empty; otherwise, <c>false</c>.
/// </value>
+ [Obsolete("This method will be removed in the next release.")]
public virtual bool IsEmpty
{
get { return Proxy.git_repository_is_empty(repo.Handle); }
Please sign in to comment.
Something went wrong with that request. Please try again.