| 2098 | } |
| 2099 | |
| 2100 | fn fake_git(oid: &str, index: &[u8]) -> WorkspaceGitObservation { |
| 2101 | use super::super::git_observation::{ |
| 2102 | GitAdminEntryKind, GitAdminPathObservation, GitOperationObservation, |
| 2103 | WorkspaceGitRepositoryObservation, |
| 2104 | }; |
| 2105 | |
| 2106 | WorkspaceGitObservation::Repository(Box::new(WorkspaceGitRepositoryObservation { |
| 2107 | worktree_git_dir: PathBuf::from(".git"), |
| 2108 | common_dir: PathBuf::from(".git"), |
| 2109 | index_path: PathBuf::from(".git/index"), |
| 2110 | head: head(oid), |
| 2111 | head_tree: Some("tree".to_string()), |
| 2112 | index_digest: Hash::of(index), |
| 2113 | index_tree: Some("tree".to_string()), |
| 2114 | index_stages: vec![0], |
| 2115 | index_lock: GitAdminPathObservation { |
| 2116 | path: PathBuf::from(".git/index.lock"), |
| 2117 | kind: GitAdminEntryKind::Missing, |
| 2118 | }, |
| 2119 | operation: GitOperationObservation { |
| 2120 | repository_state: "Clean".to_string(), |
| 2121 | markers: Vec::new(), |
| 2122 | }, |
| 2123 | })) |
| 2124 | } |
| 2125 | |
| 2126 | fn token(oid: &str, index: &[u8]) -> GitObservationToken { |
| 2127 | GitObservationToken { |