(dot_dir: &Path)
| 1377 | } |
| 1378 | |
| 1379 | fn read_current_view_if_present(dot_dir: &Path) -> Result<Option<String>, RepositoryError> { |
| 1380 | for name in ["current_view", "current_stack"] { |
| 1381 | let path = dot_dir.join(name); |
| 1382 | if path.exists() { |
| 1383 | let content = std::fs::read_to_string(path)?; |
| 1384 | let value = content.trim(); |
| 1385 | if !value.is_empty() { |
| 1386 | return Ok(Some(value.to_string())); |
| 1387 | } |
| 1388 | } |
| 1389 | } |
| 1390 | Ok(None) |
| 1391 | } |
| 1392 | |
| 1393 | fn read_legacy_current_view( |
| 1394 | working_copy_dot_dir: &Path, |