GitChange.cs 1.2 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. //
  7. // HOW TO USE:
  8. // 1. Place this script inside the "Editor" folder.
  9. // 2. This class is used by GitService.cs and ArbitratorWindow.cs.
  10. using LibGit2Sharp;
  11. using UnityEngine.Scripting;
  12. namespace Terra.Arbitrator.Services
  13. {
  14. /// <summary>
  15. /// A data container for a single file change detected by Git.
  16. /// </summary>
  17. [Preserve]
  18. public class GitChange
  19. {
  20. public string FilePath { get; private set; }
  21. public string OldFilePath { get; private set; }
  22. public ChangeKind Status { get; private set; }
  23. /// <summary>
  24. /// Represents whether the user has checked the box for this file in the UI.
  25. /// </summary>
  26. public bool IsSelectedForCommit { get; set; }
  27. public GitChange(string newPath, string oldPath, ChangeKind status)
  28. {
  29. FilePath = newPath;
  30. OldFilePath = oldPath;
  31. Status = status;
  32. IsSelectedForCommit = true; // Default to select
  33. }
  34. }
  35. }