8000 Obsolete IsEmpty property on RepositoryInformation · JanKrivanek/libgit2sharp@1f301ab · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit 1f301ab

Browse files
jamillnulltoken
authored andcommitted
Obsolete IsEmpty property on RepositoryInformation
1 parent 813be8d commit 1f301ab

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

LibGit2Sharp.Tests/CommitFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ public void CanCommitALittleBit()
618618
AssertBlobContent(commit[relativeFilepath], "nulltoken\n");
619619

620620
Assert.Equal(0, commit.Parents.Count());
621-
Assert.False(repo.Info.IsEmpty);
621+
Assert.False(repo.Info.IsHeadOrphaned);
622622

623623
File.WriteAllText(filePath, "nulltoken commits!\n");
624624
repo.Index.Stage(relativeFilepath);

LibGit2Sharp.Tests/RepositoryFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ public void CreatingRepoWithBadParamsThrows()
150150
private static void AssertInitializedRepository(Repository repo)
151151
{
152152
Assert.NotNull(repo.Info.Path);
153-
Assert.True(repo.Info.IsEmpty);
154153
Assert.False(repo.Info.IsHeadDetached);
155154
Assert.True(repo.Info.IsHeadOrphaned);
156155

@@ -215,7 +214,6 @@ public void CanOpenRepository()
215214
Assert.NotNull(repo.Info.Path);
216215
Assert.Null(repo.Info.WorkingDirectory);
217216
Assert.True(repo.Info.IsBare);
218-
Assert.False(repo.Info.IsEmpty);
219217
Assert.False(repo.Info.IsHeadDetached);
220218
}
221219
}

LibGit2Sharp.Tests/TagFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ public void CanListAllTagsInAEmptyRepository()
603603

604604
using (var repo = Repository.Init(scd.DirectoryPath))
605605
{
606-
Assert.True(repo.Info.IsEmpty);
606+
Assert.True(repo.Info.IsHeadOrphaned);
607607
Assert.Equal(0, repo.Tags.Count());
608608
}
609609
}

LibGit2Sharp/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ public void Reset(Commit commit, IEnumerable<string> paths = null)
673673
/// <returns>The generated <see cref = "Commit" />.</returns>
674674
public Commit Commit(string message, Signature author, Signature committer, bool amendPreviousCommit = false)
675675
{
676-
if (amendPreviousCommit && Info.IsEmpty)
676+
if (amendPreviousCommit && Info.IsHeadOrphaned)
677677
{
678678
throw new LibGit2SharpException("Can not amend anything. The Head doesn't point at any commit.");
679679
}

LibGit2Sharp/RepositoryInformation.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using LibGit2Sharp.Core;
1+
using System;
2+
using LibGit2Sharp.Core;
23

34
namespace LibGit2Sharp
45
{
@@ -51,6 +52,7 @@ internal RepositoryInformation(Repository repo, bool isBare)
5152
/// <value>
5253
/// <c>true</c> if this repository is empty; otherwise, <c>false</c>.
5354
/// </value>
55+
[Obsolete("This method will be removed in the next release.")]
5456
public virtual bool IsEmpty
5557
{
5658
get { return Proxy.git_repository_is_empty(repo.Handle); }

0 commit comments

Comments
 (0)
0