Find an imported change by Git sha in `view`.
(
repo: &atomic_repository::Repository,
view: &str,
sha: &str,
)
| 1082 | |
| 1083 | /// Find an imported change by Git sha in `view`. |
| 1084 | fn change_of( |
| 1085 | repo: &atomic_repository::Repository, |
| 1086 | view: &str, |
| 1087 | sha: &str, |
| 1088 | ) -> atomic_core::change::Change { |
| 1089 | let entries = repo.effective_history(Some(view)).unwrap(); |
| 1090 | for entry in entries { |
| 1091 | let change = repo.load_change(&entry.hash).unwrap(); |
| 1092 | let imported = change |
| 1093 | .unhashed |
| 1094 | .as_ref() |
| 1095 | .and_then(|v| v.get("git")) |
| 1096 | .and_then(|g| g.get("sha")) |
| 1097 | .and_then(|s| s.as_str()); |
| 1098 | if imported == Some(sha) { |
| 1099 | return change; |
| 1100 | } |
| 1101 | } |
| 1102 | panic!("no imported change for git commit {sha}") |
| 1103 | } |
| 1104 | |
| 1105 | /// Two-branch merge fixture with controllable leg commit times so both |
| 1106 | /// valid sibling orders can be exercised (review blocker 1). |
no test coverage detected