Skip to content

Commit 72e4a1e

Browse files
Yogunulltoken
authored andcommitted
Clarified documentation of BranchTrackingDetails
The properties AheadBy, BehindBy and CommonAncestor are not only null if there is no tracking branch; they are also null if the tracking branch is empty (e.g. after cloning an empty repository)
1 parent 7b70423 commit 72e4a1e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

LibGit2Sharp/BranchTrackingDetails.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ internal BranchTrackingDetails(Repository repo, Branch branch)
3131
/// <summary>
3232
/// Gets the number of commits that exist in this local branch but don't exist in the tracked one.
3333
/// <para>
34-
/// This property will return null if there is no tracked branch linked to this local branch.
34+
/// This property will return <c>null</c> if this local branch has no upstream configuration
35+
/// or if the upstream branch does not exist
3536
/// </para>
3637
/// </summary>
3738
public virtual int? AheadBy
@@ -42,7 +43,8 @@ public virtual int? AheadBy
4243
/// <summary>
4344
/// Gets the number of commits that exist in the tracked branch but don't exist in this local one.
4445
/// <para>
45-
/// This property will return null if there is no tracked branch linked to this local branch.
46+
/// This property will return <c>null</c> if this local branch has no upstream configuration
47+
/// or if the upstream branch does not exist
4648
/// </para>
4749
/// </summary>
4850
public virtual int? BehindBy
@@ -53,8 +55,8 @@ public virtual int? BehindBy
5355
/// <summary>
5456
/// Gets the common ancestor of the local branch and its tracked remote branch.
5557
/// <para>
56-
/// This property will return null if there is no tracked branch linked to this local branch,
57-
/// or if either branch is an orphan.
58+
/// This property will return <c>null</c> if this local branch has no upstream configuration,
59+
/// the upstream branch does not exist, or either branch is an orphan.
5860
/// </para>
5961
/// </summary>
6062
public virtual Commit CommonAncestor

0 commit comments

Comments
 (0)