GitChange.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (c) 2025 TerraByte Inc.
  2. //
  3. // This script defines the data model for a single Git change.
  4. // An object of this class holds information about a file that has been
  5. // added, modified, or deleted.
  6. using LibGit2Sharp;
  7. using UnityEngine.Scripting;
  8. namespace Terra.Arbitrator.Services
  9. {
  10. /// <summary>
  11. /// A data container for a single file change detected by Git.
  12. /// </summary>
  13. [Preserve]
  14. public class GitChange
  15. {
  16. public string FilePath { get; private set; }
  17. public string OldFilePath { get; private set; }
  18. public ChangeKind Status { get; private set; }
  19. public bool IsSelectedForCommit { get; set; }
  20. public ConflictResolution Resolution { get; set; } = ConflictResolution.None;
  21. public GitChange(string newPath, string oldPath, ChangeKind status)
  22. {
  23. FilePath = newPath;
  24. OldFilePath = oldPath;
  25. Status = status;
  26. IsSelectedForCommit = true;
  27. }
  28. public enum ConflictResolution
  29. {
  30. None,
  31. Mine,
  32. Theirs
  33. }
  34. }
  35. }