GitChange.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. namespace Terra.Arbitrator.Services
  12. {
  13. /// <summary>
  14. /// A data container for a single file change detected by Git.
  15. /// </summary>
  16. public class GitChange
  17. {
  18. public string FilePath { get; private set; }
  19. public string OldFilePath { get; private set; }
  20. public ChangeKind Status { get; private set; }
  21. /// <summary>
  22. /// Represents whether the user has checked the box for this file in the UI.
  23. /// </summary>
  24. public bool IsSelectedForCommit { get; set; }
  25. public GitChange(string newPath, string oldPath, ChangeKind status)
  26. {
  27. FilePath = newPath;
  28. OldFilePath = oldPath;
  29. Status = status;
  30. IsSelectedForCommit = true; // Default to select
  31. }
  32. }
  33. }