| 662 | |
| 663 | impl WorkspaceGitObservation { |
| 664 | pub fn token(&self) -> GitObservationToken { |
| 665 | match self { |
| 666 | Self::NoGit { .. } => GitObservationToken { |
| 667 | head: GitHeadObservation::Unborn { |
| 668 | symref: "no-git".to_string(), |
| 669 | }, |
| 670 | head_tree: None, |
| 671 | index_digest: Hash::ZERO, |
| 672 | index_tree: None, |
| 673 | index_stages: Vec::new(), |
| 674 | index_locked: false, |
| 675 | repository_state: "NoGit".to_string(), |
| 676 | markers: Vec::new(), |
| 677 | }, |
| 678 | Self::Repository(repository) => GitObservationToken { |
| 679 | head: repository.head.clone(), |
| 680 | head_tree: repository.head_tree.clone(), |
| 681 | index_digest: repository.index_digest, |
| 682 | index_tree: repository.index_tree.clone(), |
| 683 | index_stages: repository.index_stages.clone(), |
| 684 | index_locked: repository.index_lock.is_present(), |
| 685 | repository_state: repository.operation.repository_state.clone(), |
| 686 | markers: repository.operation.present_markers(), |
| 687 | }, |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | #[derive(Clone, Debug, Eq, PartialEq)] |