feat(git): add ListLocalBranchesAsync

This commit is contained in:
Mika Kuns
2026-04-22 09:23:35 +02:00
parent 93ee7b72d5
commit 2d807aa606
2 changed files with 28 additions and 0 deletions

View File

@@ -34,4 +34,19 @@ public class GitServiceMergeTests : IDisposable
Assert.True(branch == "main" || branch == "master",
$"Expected main or master, got '{branch}'");
}
[Fact]
public async Task ListLocalBranchesAsync_AfterCreatingSecondBranch_ReturnsBoth()
{
if (!GitRepoFixture.IsGitAvailable()) return;
var repo = NewRepo();
GitRepoFixture.RunGit(repo.RepoDir, "branch", "feature/x");
var git = new GitService();
var branches = await git.ListLocalBranchesAsync(repo.RepoDir);
Assert.Contains("feature/x", branches);
Assert.True(branches.Any(b => b == "main" || b == "master"));
}
}