IConflictSource.cs 1008 B

123456789101112131415161718192021222324252627
  1. // Copyright (c) 2025 TerraByte Inc.
  2. //
  3. // Defines a generic interface for any operation that can result in a merge
  4. // conflict, such as a pull or a stash apply. This allows the conflict
  5. // resolution UI to be agnostic to the source of the conflict.
  6. using Terra.Arbitrator.Promises;
  7. using System.Collections.Generic;
  8. namespace Terra.Arbitrator.Services
  9. {
  10. /// <summary>
  11. /// Provides a standardized way to handle different types of merge conflicts.
  12. /// </summary>
  13. public interface IConflictSource
  14. {
  15. public string MineLabel { get; }
  16. public string TheirsLabel { get; }
  17. /// <summary>
  18. /// Executes the logic to resolve the conflicts based on the user's choices.
  19. /// </summary>
  20. /// <param name="resolutions">The list of files and their chosen resolution.</param>
  21. /// <returns>A promise that resolves with a success message or rejects with an error.</returns>
  22. public IPromise<string> Resolve(List<GitChange> resolutions);
  23. }
  24. }