GitChange.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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
  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 ChangeKind Status { get; private set; }
  20. /// <summary>
  21. /// Represents whether the user has checked the box for this file in the UI.
  22. /// </summary>
  23. public bool IsSelectedForCommit { get; set; }
  24. public GitChange(string filePath, ChangeKind status)
  25. {
  26. FilePath = filePath;
  27. Status = status;
  28. IsSelectedForCommit = true; // Default to select
  29. }
  30. }
  31. }