Skip to content

Tracked branch details #75

Description

@dahlbyk

Proposal to add the following to Branch:

  • bool IsTracking { get; }
  • Branch TrackedBranch { get; }
  • int AheadBy { get; }
  • int BehindBy { get; }

Which would satisfy the following:

Branch branch = repo.Branches["test"];
branch.IsTracking.ShouldBeFalse();
branch.TrackedBranch.ShouldBeNull();
branch.AheadBy.ShouldEqual(0);
branch.BehindBy.ShouldEqual(0);

Branch master = repo.Branches["master"];
master.IsTracking.ShouldBeTrue();
master.TrackedBranch.ShouldEqual(repo.Branches["refs/remotes/origin/master"]);
master.AheadBy.ShouldEqual(1);
master.BehindBy.ShouldEqual(2);

(assuming master has one commit origin/master doesn't and origin/master has two commits master doesn't)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions