Skip to content

Commit

Permalink
Fix integrate force by adding fetch
Browse files Browse the repository at this point in the history
Fix issue where integrate force can get out of sync because it didn't do
a fetch at the beginning. This addresses that by having the force do a
fetch before the rest of the integration process.

[changelog]
fixed: issue where integrate force wasn't fetching before integrating
  • Loading branch information
drewdeponte committed May 5, 2022
1 parent 3e862c5 commit 8d28584
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ps/public/integrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ pub fn integrate(patch_index: usize, force: bool, keep_branch: bool, given_branc
}

if force {
// fetch so we get new remote state
git::ext_fetch().map_err(IntegrateError::FetchFailed)?;

let (branch, ps_id) = ps::private::request_review_branch::request_review_branch(&repo, patch_index, given_branch_name_option).map_err(IntegrateError::BranchOperationFailed)?;

// publish the patch from the local rr branch up to uptstream
Expand All @@ -76,8 +79,6 @@ pub fn integrate(patch_index: usize, force: bool, keep_branch: bool, given_branc
let pattern = format!("refs/remotes/{}/", remote_name_str);
let upstream_branch_shorthand = str::replace(&branch_upstream_name, pattern.as_str(), "");



// e.g. git push origin ps/rr/whatever-branch:main
git::ext_push(false, remote_name_str, rr_branch_name, &upstream_branch_shorthand).map_err(IntegrateError::PushFailed)?;

Expand Down

0 comments on commit 8d28584

Please sign in to comment.