Check if there are local-only changes (changes not on the remote). Returns true if the local repository has changes that are not present on the remote. This indicates a potential divergence in history. # Arguments `local_entries` - Local history entries `remote_entries` - Remote changelist entries # Returns `true` if there are local changes not present on the remote. # Example ```rust,ignor
(
local_entries: &[HistoryEntry],
remote_entries: &[ChangelistEntry],
)
| 123 | /// } |
| 124 | /// ``` |
| 125 | pub fn has_local_only_changes( |
| 126 | local_entries: &[HistoryEntry], |
| 127 | remote_entries: &[ChangelistEntry], |
| 128 | ) -> bool { |
| 129 | // Empty local means no local-only changes |
| 130 | if local_entries.is_empty() { |
| 131 | return false; |
| 132 | } |
| 133 | |
| 134 | // Build set of remote hashes |
| 135 | let remote_hashes: HashSet<String> = remote_entries.iter().map(|e| e.hash.clone()).collect(); |
| 136 | |
| 137 | // Check if any local change is not on remote |
| 138 | local_entries |
| 139 | .iter() |
| 140 | .any(|e| !remote_hashes.contains(&e.hash.to_base32())) |
| 141 | } |
| 142 | |
| 143 | /// Find all local-only change hashes. |
| 144 | /// |