40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using MarketAlly.GitCommitEditor.Models;
|
|
|
|
namespace MarketAlly.GitCommitEditor.Services;
|
|
|
|
/// <summary>
|
|
/// Manages repository discovery and registration.
|
|
/// </summary>
|
|
public interface IRepositoryManager
|
|
{
|
|
IReadOnlyList<ManagedRepo> Repos { get; }
|
|
|
|
Task<IReadOnlyList<ManagedRepo>> ScanAndRegisterReposAsync(CancellationToken ct = default);
|
|
Task<ManagedRepo> RegisterRepoAsync(string repoPath);
|
|
Task<bool> UnregisterRepoAsync(string repoIdOrPath);
|
|
IEnumerable<BranchInfo> GetBranches(string repoPath);
|
|
|
|
/// <summary>
|
|
/// Checkout a branch in the specified repository.
|
|
/// </summary>
|
|
/// <param name="repo">The repository to switch branches in.</param>
|
|
/// <param name="branchName">The name of the branch to checkout.</param>
|
|
/// <returns>True if checkout succeeded, false otherwise.</returns>
|
|
Task<bool> CheckoutBranchAsync(ManagedRepo repo, string branchName);
|
|
|
|
/// <summary>
|
|
/// Gets all backup branches in the specified repository.
|
|
/// </summary>
|
|
IEnumerable<BackupBranchInfo> GetBackupBranches(string repoPath);
|
|
|
|
/// <summary>
|
|
/// Deletes a local branch.
|
|
/// </summary>
|
|
bool DeleteBranch(string repoPath, string branchName);
|
|
|
|
/// <summary>
|
|
/// Deletes all backup branches in the specified repository.
|
|
/// </summary>
|
|
int DeleteAllBackupBranches(string repoPath);
|
|
}
|