(local: &Repository)
| 99 | } |
| 100 | |
| 101 | fn fast_forward_merge(local: &Repository) -> Result<(), AppError> { |
| 102 | let head_ref = local.head()?; |
| 103 | if head_ref.is_branch() { |
| 104 | let branch = Branch::wrap(head_ref); |
| 105 | let upstream = branch.upstream()?; |
| 106 | let upstream_commit = local.reference_to_annotated_commit(upstream.get())?; |
| 107 | |
| 108 | let (analysis_result, _) = local.merge_analysis(&[&upstream_commit])?; |
| 109 | if MergeAnalysis::is_fast_forward(&analysis_result) { |
| 110 | let target_id = upstream_commit.id(); |
| 111 | local.checkout_tree(&local.find_object(upstream_commit.id(), None)?, None)?; |
| 112 | local.head()?.set_target(target_id, "fw fast-forward")?; |
| 113 | } |
| 114 | } |
| 115 | Ok(()) |
| 116 | } |
| 117 | |
| 118 | pub fn clone_project(config: &Config, project: &Project, path: &Path) -> Result<(), AppError> { |
| 119 | let shell = config.settings.get_shell_or_default(); |
no outgoing calls
no test coverage detected