Scope-specific Git representation of a view (RFC §8.1).
(scope: ViewScope, view: &str)
| 45 | |
| 46 | /// Scope-specific Git representation of a view (RFC §8.1). |
| 47 | pub fn mapped_local_ref(scope: ViewScope, view: &str) -> Option<String> { |
| 48 | match scope { |
| 49 | // Shared views publish on a real branch (symbolic HEAD). |
| 50 | ViewScope::Shared => Some(format!("refs/heads/{view}")), |
| 51 | // Drafts publish on the private namespace (detached HEAD). |
| 52 | ViewScope::Draft => Some(format!("refs/atomic/views/{view}")), |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | /// Ephemeral `git/<oid>` views have no extra ref beyond the original commit |
| 57 | /// (RFC §8.1): their mapping deliberately carries `local_ref: None`. |
no outgoing calls