Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
geofflamrock committed Dec 20, 2024
1 parent 24e37be commit 4410d0b
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/Stack/Git/GitOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public interface IGitOperations
string[] GetBranchesThatHaveBeenMerged(string[] branches, string sourceBranchName);
(int Ahead, int Behind) GetStatusOfRemoteBranch(string branchName, string sourceBranchName);
(int Ahead, int Behind) CompareBranches(string branchName, string sourceBranchName);
(int Ahead, int Behind) GetComparisonToRemoteTrackingBranch(string branchName);
Commit GetTipOfBranch(string branchName);
Dictionary<string, GitBranchStatus> GetBranchStatuses(string[] branches);
string GetRemoteUri();
string[] GetLocalBranchesOrderedByMostRecentCommitterDate();
Expand Down Expand Up @@ -153,20 +151,6 @@ public string[] GetBranchesThatHaveBeenMerged(string[] branches, string sourceBr
return (int.Parse(parts[0]), int.Parse(parts[1]));
}

public (int Ahead, int Behind) GetComparisonToRemoteTrackingBranch(string branchName)
{
var status = ExecuteGitCommandAndReturnOutput($"rev-list --left-right --count {branchName}...origin/{branchName}").Trim();
var parts = status.Split('\t');
return (int.Parse(parts[0]), int.Parse(parts[1]));
}

public Commit GetTipOfBranch(string branchName)
{
var commit = ExecuteGitCommandAndReturnOutput($"rev-list -n 1 {branchName}").Trim();
var message = ExecuteGitCommandAndReturnOutput($"log -1 --pretty=%B {commit}").Trim();
return new Commit(commit, message);
}

public Dictionary<string, GitBranchStatus> GetBranchStatuses(string[] branches)
{
var statuses = new Dictionary<string, GitBranchStatus>();
Expand Down

0 comments on commit 4410d0b

Please sign in to comment.